DB displays "Resource id #3" instead of string, wh
Posted: Wed Jan 10, 2007 7:05 pm
Hey guys, I wrote the following code to read from my db (the username and password in my file are different):
The cell circled in red is the one that's supposed to be read (assuming that my code is correct)

But instead of getting "result: yes", I end up getting "result: Resource id #3"
What does "Resource id #3" mean and Why does it appear instead of my actual value? Is my code wrong?
Thank you very much
Yuval Karmi
Code: Select all
<?php
$user="me";
$password="1234";
$database="testdb";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT round1 FROM purchased WHERE user = 'test'";
$result=mysql_query($query);
echo "result: ".$result;
?>
But instead of getting "result: yes", I end up getting "result: Resource id #3"
What does "Resource id #3" mean and Why does it appear instead of my actual value? Is my code wrong?
Thank you very much
Yuval Karmi