How to group by date with Codeigniter active record?
this line,
$this->db->group_by(Month('date'), Year('date'));
Month is a PHP function at this line. If you want to use SQL MONTH and YEAR functions, this line must be like this:
$this->db->group_by('MONTH(date), YEAR(date)');