Hello, I am using CodeIgniter for this project and have chosen to use FlexiGrid for displaying data driven tables in the site's admin tool. The requirement of the project is to display count's and date's related to a record in a query. The only way I know how to do this is to use a sub-query. All of the data is displaying as intended. However, the columns with the subquery are not sortable and are not searchable.
Has anyone had this problem? Am I going about this the wrong way?
Query in question:
$this->db->select('customers.id,CONCAT(customers.first_name," ",customers.last_name) as full_name, customers.first_name as first_name, customers.last_name as last_name, comments.id as comment_id, (select count(comments.id) from comments comments where customers.id = comments.app_id) as LastComment',FALSE); $this->db->from('customers'); $this->db->join('comments','customers.id = comments.id','right' );