我想从数据库中获得一个result_array()
,其中两列必须返回true,反之亦然,所以我决定使用or_where
但我的代码返回Call to undefined method CI_DB_mysqli_result::or_where()
错误,任何建议如何能实现这一目标?Codeigniter如何使用get_where/or_where一起返回result_array
我在CI_Model里面使用了下面的代码。
public function check_request($userid, $senderid){
$query = $this->db->get_where('connection',array('user_id' => $userid, 'sender_id' => $senderid));
$query = $this->db->or_where('connection',array('sender_id' => $userid, 'user_id' => $senderid));
return $query->result_array();
}
plz更新问题和显示你在哪里使用这个功能 –