Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP/MySQL query is simple, but not returning a value. Any advice? 2

Status
Not open for further replies.

topjimmie

IS-IT--Management
Feb 4, 2002
28
0
0
US
Need some help if someone would be kind enough to offer. I'm modifying the edit view in JEvents All I'm trying to do is lookup the eventdetail_id from a table. I have gone through countless permutations of this code and every time it returns as if there is not a matching record (array, etc). I know there is a matching record, and the eventdetail_id should return 35.
Code:
//fyi: Values already assigned are: $rp_id=3516 and $evtID=3516

$detailid = "SELECT eventdetail_id FROM jos_jevents_repetition WHERE rp_id =".$evtID;
$db->setQuery( $detailid );
$jbIds= $db->loadObjectList();
$jbId=mysql_fetch_array($jbIds)
I'm not a PHP expert so if something does not follow my limited expectations, I try stuff and hope to find the answer. I'm out of things to try. Unfortunately, the task at hand doesn't always respect your skill level.

Any help is appreciated

Jevents: 1.5.4
Database Version: 5.1.36-community-log
Database Collation: utf8_general_ci
PHP Version: 5.2.5
Web Server: Apache/2.2.11 (Win32) PHP/5.2.5
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.15 Stable
 
The first thing I'd do is print out the value built up in $detailid, just to make sure it is what you think it is. The second thing is to run that query in phpmyadmin (or similar) to make sure it returns what you think it returns.

Then you can worry about the rest of it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top