Reputation: 1712
I am looking for query in Codeigniter works like where OR, AND both works.
This is working Perfect!
$srcArr2['emp_id']=8;
$srcArr2['status']='2';
$this->db->where($srcArr2);
$query = $this->db->get('tickets');
$res = $query->result_array(); // as array
print_r ($res);
query is:
Need to add OR in where with $srcArr1['ass_id']=12; I try but not working.
$srcArr1['ass_id']=12;
$srcArr2['emp_id']=8;
$srcArr2['status']='2';
$this->db->where($srcArr2);
$this->db->where_in($srcArr1);
$query = $this->db->get('tickets');
$res = $query->result_array(); // as array
print_r ($res);
Thank You, in Advance for help
Upvotes: 0
Views: 52
Reputation: 31
$this->db->where($srcArr2);
$this->db->or_where($srcArr1);
https://www.codeigniter.com/user_guide/database/query_builder.html#looking-for-specific-dataenter link description here
Upvotes: 1