or where in codeigniter code example
Example 1: 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;
}
Example 2: codeigniter select for update
$table = "my_table";
$id = 1;
$update = ["status"=>"working"];
$query = $this->db->select()
->from($table)
->where('id', $id)
->get_compiled_select();
$data = $this->db->query("$query FOR UPDATE")->row_array();
$this->db->where('id', $data['id'])->update($table,$update);