[eluser]Mirage[/eluser]
Quote:How can i see what is wrong with the querys?
$log_treshold is at 4.
To see the sql statement that was executed, turn on db_debug in the database config and/or add this line after your code to see it in the log:
Code:
//Build count query
$this->db->select(‘count(timeOfBilling) as record_count’)->from($table_name);
$this->CI->flexigrid->build_query(FALSE);
$record_count = $this->db->get();
log_message('debug', var_export($this->db->last_query(), true));
$row = $record_count->row();
$return[‘record_count’] = $row->record_count;
I'm also pretty sure that you're using the select method of the AR wrong. That method is supposed to take a list of fields, not a whole query. For doing a direct query you'd use $this->db->query($sql);
Cheers,
-m