I am getting this error when I pass an invalid SQL string... I spent the last hour trying to find the problem assuming - It\'s not my SQL it must be the db handle... ANyway, I\'
mysql_query will return false if there is an error
false
$result = mysql_query('select * from'); if ($result === false) { // caused by my invalid input above } else { // process as usual }
In fact, you're getting the error you describe because you're literally calling mysql_num_rows(false)
mysql_num_rows(false)