if(mysql_num_rows($result))
{
echo "no match found!";
}
它正在抛出一个错误 -
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Hosting\6448289\html\includes\getQuestion.php on line 72
答案 0 :(得分:5)
您需要检查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.
如果mysql_query
失败,则返回boolean
false
而不是resource
。
将此boolean
值传递给mysql_num_rows
时,会出现此错误。