-1
我一直試圖深入研究腳本,但仍然找不到問題。 這裏的腳本mysqli_num_rows()期望參數1是mysqli_result,給定的數組
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';
}
出現是
mysqli_num_rows() expects parameter 1 to be mysqli_result, array given
提前謝謝你的錯誤。
變量$ con中的代碼是什麼? –
[mysqli \ _fetch \ _array()/ mysqli \ _fetch \ _assoc()/ mysqli \ _fetch \ _row()的可能重複需要參數1爲資源或mysqli \ _result,布爾值給定](http://stackoverflow.com/questions/2973202/mysqli-fetch-array-mysqli-fetch-assoc-mysqli-fetch-row-expect-parameter-1) –
@AdhanTimothyYounes mysqli_connect($ host,$ user,$ pass,$ db); –