我不确定为什么会发生这种情况,因为某些函数正在mysqli_fetch_assoc
与 while 循环一起使用,而另一些函数mysqli_fetch_assoc
在函数中的 while 循环中不起作用。
我使用了以下 PHP 脚本
function get_customer_record_list($table,$pos_customer){
$sql = "SELECT * FROM ".$table." WHERE pos_customer = '$pos_customer' order by added_date DESC";
$select =mysqli_query($this->connect,$sql)or die("Query (List) is not executed.");
while($row = mysqli_fetch_assoc($select)){
$result [] = $row;
}
echo "working";exit();
//return $result;
}
关闭值后不工作不打印while loop
,$result
关闭循环后也不显示任何内容。
数据库中有501
记录但数据不打印使用mysqli_fetch_assoc
我也尝试mysqli_fetch_object
使用foreach
循环但数据不打印。
我不知道为什么会这样。