關于mysqli_fetch_array() 函數問題
我明明把結果集query了,但總是警告我mysqli_fetch_array()第一個參數期望是mysqli_result
function fetchOne($sql,$result_type=MYSQLI_ASSOC){
// $link=mysqli_connect("localhost","root","123456");
$con=mysqli_connect("localhost","root","123456");
$result=mysqli_query($con,$sql);
$row = mysqli_fetch_array($result,$result_type);
return $row;
}
是代碼哪里有問題嗎
2019-12-11
$result=mysqli_query($link,$sql);
if (!$result) {
printf("Error: %s\n", mysqli_error($link));
exit();
}?
$row=mysqli_fetch_array($result,$result_type);