I am new to php & mysql and have a problem getting mysql_num_rows to return the correct number of rows. Here is my code:
$tr110 = mysql_query("SELECT ad FROM classified WHERE category_number=110");
$rc110 = mysql_num_rows($tr110);
print " ($rc110)";
Here is the problem: If 0 rows exist mysql sometimes returns 0 and sometimes returns 1. If 1 or more rows exist, it always returns 1 more than the number of rows that exist. Please help!!
PHP Version 4.3.2
MySQL Version 4.0.15
MAC OS X (Darwin)
also tried on
PHP Version 4.3.4
MySQL Version 3.23.49
Windows NT 5.2