Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db->where('lower(status) <>', 'completed');
- $this->db->order_by('calldate','asc');
- $q1 = $this->db->get('records'); //where and orderby applies to this query only
- $q2 = $this->db->get('other_records'); //where and orderby does not apply to this
- $data1 = $q1->result_array();
- $data2 = $q2->result_array();
- $data = array_merge($data1, $data2);
- $this->db->where('lower(status) <>', 'completed');
- $this->db->order_by('calldate','asc');
- $q = $this->db->get('records'); //where and orderby applies to this query only
- $data1 = $q->result_array();
- $q = $this->db->get('other_records'); //where and orderby does not apply to this
- $data2 = $q->result_array();
- $data = array_merge($data1, $data2);
- SELECT * FROM records WHERE lower(status)<>'completed' ORDER BY calldate ASC
- UNION
- SELECT * FROM other_records WHERE lower(status)<>'completed' ORDER BY calldate ASC
Add Comment
Please, Sign In to add comment