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!

What is meant by "supplied argument is not a valid MySQL result"?

Status
Not open for further replies.

JerryGolem

Programmer
Mar 4, 2003
2
US
I am new to mysql and have created a script that is trying to access a database that I have created on my ISP. I have no idea what the following message means. Please help. I got the example from "Create Dynamic Web Pages Using PHP and Mysql" by David Tansley.

Message:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jgolem/public_html/insertcust.php on line 48

Code:
$sql = 'SELECT `CustomerEmail` FROM `CustomerInformation` WHERE 1 AND `CustomerEmail` = \'jgolem@hotmail.com\' LIMIT 0, 30';
# Line 41

$result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($result);

 
That means that you don't check for errors. A simple [tt]or die("Error: " . mysql_error())[/tt] after [tt]mysql_query($sql)[/tt] would help you diagnose the problem. //Daniel
 
Thank you Daniel!!! This got me through a tough time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top