Help With Getting Values Please!

From: Date: Wed, 23 May 2001 06:09:21 +0000
Subject: Help With Getting Values Please!
Groups: php.db 
Request: Send a blank email to php-db+get-9570@lists.php.net to get a copy of this message
Greetings. I'm trying to get a value for a single cell out of a table and into a variable. I receive the following error message: Warning: Supplied argument is not a valid MySQL result resource in /home/etc.... My code (abbreviated) is as follows: $sql2 = "SELECT ServiceDes FROM ServiceTypes WHERE ServiceID = $serviceid"; $service_type = mysql_result($sql2, 1); The value in $serviceid is valid and displays fine. I'm simply trying to retrieve the value of ServiceDes from a different table which also has a column named serviceid, which is unique to the table. I'm very new to PHP, but I do have lots of SQL experience. I'm used to defining variables using indicators (ie. SELECT column INTO varname FROM tablename WHERE....), but this didn't seem to work using PHP/MYSQL. Thanks, Dan

« previous php.db (#9570) next »