Guest User

Untitled

a guest
Jul 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. $this->db->where('lower(status) <>', 'completed');
  2. $this->db->order_by('calldate','asc');
  3.  
  4. $q1 = $this->db->get('records'); //where and orderby applies to this query only
  5. $q2 = $this->db->get('other_records'); //where and orderby does not apply to this
  6. $data1 = $q1->result_array();
  7. $data2 = $q2->result_array();
  8. $data = array_merge($data1, $data2);
  9.  
  10. $this->db->where('lower(status) <>', 'completed');
  11. $this->db->order_by('calldate','asc');
  12.  
  13. $q = $this->db->get('records'); //where and orderby applies to this query only
  14. $data1 = $q->result_array();
  15. $q = $this->db->get('other_records'); //where and orderby does not apply to this
  16.  
  17. $data2 = $q->result_array();
  18. $data = array_merge($data1, $data2);
  19.  
  20. SELECT * FROM records WHERE lower(status)<>'completed' ORDER BY calldate ASC
  21. UNION
  22. SELECT * FROM other_records WHERE lower(status)<>'completed' ORDER BY calldate ASC
Add Comment
Please, Sign In to add comment