get query codeigniter code example
Example 1: codeigniter raw query
$sql="Select * from my_table where 1";
$query = $this->db->query($SQL);
return $query->result_array();
Example 2: where_in codeigniter
$this->db->select('ae_users.employee_id, ae_users.emp_name, ae_users.emp_name2, ae_users.emp_name3');
$this->db->from('ae_users');
$this->db->where_in('ae_users.employee_id',$employee_ids);
$query =$this->db->get();
if ($query->num_rows()) {
return $query->result_array();
} else {
return 0;
}