I'm trying to do this:
$result = mysql_query($query);
if (mysql_num_rows($result) > 0)
{
// do stuff
}
The problem is, in some cases the query isn't returning anything. This is fine and expected, but mysql_num_rows($result) keeps giving me an error. I thought if I checked that the number of rows in the result was greater than 0, that would week out any results that didn't have rows, but apparently it isn't.
Is there a more appropriate check to see that a result really is a result before trying to do stuff with it?