I have the following script that is supposed to allow me to access a mysql database. Everything works until I get to line 41 $num = mysql_num_rows($result);
I get an error message Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
Here is lines 38 through 42 of the script. Why am I getting the error message and what is the fix.
$query = "SELECT * from lines ORDER BY Year";
$result=mysql_query($query);
$num = mysql_num_rows($result);
mysql_close();
I get an error message Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
Here is lines 38 through 42 of the script. Why am I getting the error message and what is the fix.
$query = "SELECT * from lines ORDER BY Year";
$result=mysql_query($query);
$num = mysql_num_rows($result);
mysql_close();