Tag Archives: query

Get count of rows from joined tables in Codeigniter

Share on TwitterDigg This

we can select count the number of rows in a joined table using codeigniter active record For simple example consider two tables vehicles and trips.By join this two tables we need to list the vehicle with total count of trips … Continue reading

codeigniter active record sub query using where not in

Share on TwitterDigg This

using sub query in where clause in codeigniter $this->db->where(); This function enables you to set WHERE clauses $names = array(’Frank’, ‘Todd’, ‘James’); $this->db->where_in(’username’, $names); // Produces: WHERE username IN (‘Frank’, ‘Todd’, ‘James’)   $this->db->where(’`store_id` NOT IN (SELECT `store_id` FROM `user_store`)’, … Continue reading