problem with mysql_num_rows
Posted: Thu Jan 17, 2008 3:11 pm
I'm having some issues trying to get a count with "mysql_num_rows". Here's my code and the errors I am getting. (I also tried using the count(*) function but had no luck. Thanks in advance for any help.
Here's the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jpobrien/public_html/staff/customer_new_enter.php on line 56
There was a problem with the database server. Please try again later
Code: Select all
//Connecting to the database
$db = mysql_connect("localhost", "user", "pass");
mysql_select_db ("jpobrien");
$result = mysql_query("select first_name_1 from Customers", $db);
$number = mysql_num_rows($result);
$customer_id = $number + 9000;Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jpobrien/public_html/staff/customer_new_enter.php on line 56
There was a problem with the database server. Please try again later