最新消息:

php报错:Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in E:\php

编程 eben 1203浏览

菜鸡一只,今天调取数据库数据时,一直报一个错:Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in E:\php

后来在网上找了一个很实用的解决方法:

只需要在php文件中写入这样几行代码,便可以“知错就改”了

$result = mysqli_query($con,$sql);   
 
if (!$result) {
    printf("Error: %s\n", mysqli_error($con));
    exit();
}

 

转载请注明:落伍老站长 » php报错:Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in E:\php