mysqli_num_rows() expects parameter 1 to be mysqli_result, array given

谁说我不能喝 提交于 2019-12-25 18:14:09

问题


I've been trying to look deep into the script, but I still can't find the problem. here's the script

global $con;
$a= "SELECT id_list FROM list ORDER BY id_list";
$b = mysqli_query($con, $a);
$c=  mysqli_fetch_assoc($b);        
    if(mysqli_num_rows($c)==0){
        echo'0';
    }else{
        echo '1';
    }       

the error that appear is

mysqli_num_rows() expects parameter 1 to be mysqli_result, array given

thank you in advance.


回答1:


You have use mysqli_result parameter so mysqli_num_rows($b) .

read manual here link



来源:https://stackoverflow.com/questions/42358924/mysqli-num-rows-expects-parameter-1-to-be-mysqli-result-array-given

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!