Musíte zkontrolovat návratovou hodnotu mysql_query
$query = 'YOUR QUERY';
$result = mysql_query($query);
if (!$result) {
trigger_error('Invalid query: ' . mysql_error()." in ".$query);
}
// go ahead and fetch the results using mysql_num_rows.
Pokud mysql_query selže, vrátí boolean false místo resource .
Když předáte tento boolean hodnotu na mysql_num_rows zobrazí se tato chyba.