ppp*_*ppp 1 php mysql sql warnings mysql-num-rows
if(mysql_num_rows($result))
{
echo "no match found!";
}
Run Code Online (Sandbox Code Playgroud)
这是一个错误 -
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Hosting\6448289\html\includes\getQuestion.php on line 72
你需要检查的返回值 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.
Run Code Online (Sandbox Code Playgroud)
如果mysql_query失败则返回boolean false而不是a resource.
将此boolean值传递给mysql_num_rows您时会出现此错误.
| 归档时间: |
|
| 查看次数: |
3965 次 |
| 最近记录: |