I want to write the given query in codeigniter , how can I do so?
SELECT * FROM `user` WHERE `id` IN (select `provider_id` from `services`);
I gone through codeigniter's where_in() but i'm getting wrong result , here what I have done,
$this->db->select('*');
$this->db->from(USER);
$this->db->where_in('id', 'select `provider_id` from `services`');
$query = $this->db->get();
return $query->num_rows();
it is returning 0, while the query above, when run directly in phpmyadmin, returns 1 record.