By using subquery library function how is it possible to select a record that matches the condition from both tables in subquery...?
Here is the actual sql query
SELECT *, (SELECT count('report_id')
FROM report
WHERE report.category = category.cat_id
and report.user_id IN (68, 69, 70)) AS cnt
FROM (`category`)
I need the equivalent in codeigniter as:
$this->db->select('*')->from('category');
$sub = $this->subquery->start_subquery('select');
$sub->select("count('report_id')")->from('report')
->where_in(array('user_id'=>(68, 69, 70)));
$this->subquery->end_subquery('number');
In this how can i put my second condition...???