Search code examples
phpcodeigniteractiverecordquery-builderwhere-in

Can where_in() be called more than once in a single CodeIgniter active record?


I am using codeigniter active record query.

function select_in($table,$cond)
{
    $this->db->select('*');
    $this->db->from($table);
    $this->db->where_in('brand_id',$cond);
    $query = $this->db->get();
    //echo $this->db->last_query();  exit;
    return $query;
}

I need to pass another one where_in() condition in this query. Is it Possible?


Solution

  • Try with -

    $this->db->where_in('brand_id',$cond);
    $this->db->where_in('field' , $cond_new);