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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resource ID problem???

Status
Not open for further replies.

k3bap

Programmer
Jul 9, 2003
8
GB
I have the following problem:

$sql_car = "SELECT Car FROM cars c INNER JOIN numberplate n ON n.Model = c.Model WHERE NumberPlate='RVVG12'";

$carModel = mysql_query($sql_car) or die("MySQL Error: " . mysql_error());

The query itself works fine in something like PhpMyAdmin however when I use it in PHP just as shown above instead of the the actual car model I get something like "Resource id #3"

Does anyone have an idea of what I am doing wrong here?

 
$carModel is the resultset that is holding the value of the column car.

try this:
$carModel = mysql_query($sql_car) or die("MySQL Error: " . mysql_error());
$row=mysql_fetch_row($carModel);
echo $row[0];



Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top