【发布时间】:2015-11-19 01:36:46
【问题描述】:
我想将数组中的值保存到变量中。用于进行 if 条件检查。这是我在模型文件夹中的代码。我得到一个错误mysqli_fetch_array() 期望参数 1 是 mysqli_result,给定对象。但是 $query 返回一个数组值。
public function this_is_try(){
$this->db->select('*');
$this->db->from('partnerprofile');
$this->db->where('User_Id','20');
$query = $this->db->get();
$query->result_array();
$row = mysqli_fetch_array($query);
$user_id = $row['User_Id'];
$agefrom = $row['AgeFrom'];
print $user_id;
exit;
}
【问题讨论】:
标签: php codeigniter