I am using codeigniter, i want to select data from a table which has two columns lab_id and service_id
lab_id service_id 1 1 1 2 3 1
and i only want to select lab_id "1" which has both 1 and 2 as service id. currently i am using following code but not working.
<pre>
$this->db->select('lab_id');
$this->db->from('labs_services_mapping');
foreach ($data as $value) {
$this->db->where('service_id',$value['id']);
}
$this->db->group_by('lab_id');
$query = $this->db->get()->result();
</pre>
$data is an array with service_id