2
它是用PHP编写的,
,有时当我重新启动mysql的,
会报告:
Debug Warning:line 24 - mysql_fetch_array(): supplied argument is not a valid MySQL result resource
有什么方法可以检测$ result是否是有效的MySQL结果资源?
它是用PHP编写的,
,有时当我重新启动mysql的,
会报告:
Debug Warning:line 24 - mysql_fetch_array(): supplied argument is not a valid MySQL result resource
有什么方法可以检测$ result是否是有效的MySQL结果资源?
如果出现错误,它将是错误的。
if ($result) {
$row = mysql_fetch_array($result);
} else {
echo "MySQL error: " . mysql_error();
}
或者你可以只是做:
if ($result) {
$row = mysql_fetch_array($result);
// Do everything you need to in here
}