mysqli_fetch_array() expects parameter 1 to be mysqli_result

问题:

PHP读取MySQL数据库报错,mysqli_fetch_array() expects parameter 1 to be mysqli_result

原因:

获取的array()可能是空的

更可能是自己PHP查找MySQL的语句错了

解决:

对返回的数据进行判断,如果没有输出报错退出

if (!$data) {

printf("Error: %s\n", mysqli_error($dbc));

exit();

}

你可能感兴趣的:(mysqli_fetch_array() expects parameter 1 to be mysqli_result)