我正在寻求将此MySQL查询隐蔽到Codeigniter语法中,以用于所有in函数。
SELECT * FROM `task` WHERE (status='0' AND priority='0' AND close_request='0') AND (emp_id='8' OR ass_id='8')
我尝试但不起作用:
$Arr1['close_request']='0';
$Arr1['priority']='0';
$Arr1['status']='0';
$Arr2['emp_id']=8;
$Arr2['ass_id']=8;
$this->db->where($Arr1);
$this->db->where_in($Arr2);
$query = $this->db->get('task');
$result = $query->result_array(); // as array
print_r ($result);