【发布时间】:2018-08-25 02:01:58
【问题描述】:
我正在使用核心 php,实际上我是通过提交表单来获取 post 值,我将在显示问题时将该变量传递给 like 查询:
致命错误:不能使用 mysqli_result 类型的对象作为数组 C:\xampp.
我不知道我做错了什么请帮助我。
这是我的代码:
if(isset($_POST['list'])){
//-----from post value----//
$location_type =$_POST['list'];
$arr = explode(' ',trim($location_type));
$listing=$arr[0];
$all_location ="select * from tbl_master_property where pg_address like '%$listing%'";
$location_result=$conn->query($all_location);
while($row=mysqli_fetch_assoc($location_result)){
$location_result[] = $row['pg_address'];
}
echo "<pre>";print_r($location_result);die;
}
【问题讨论】:
-
Raj 错误消息也会明确告诉您行号。请说明是哪一行导致了问题