CodeIgniter Forums

Full Version: In aggregated without GROUP BY error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have recently updated my local WAMP testing platform to version 3 (I know, bad mistake).  Something that was previously working fine is now coming up with this big error and I really don't know what it means.

This is what is in the controller:

PHP Code:
$data['this_month_uniques'] = $this->Analytics_model->get_month_page_views('0 months'true'unique_hits'); 

This is what is in the model:

PHP Code:
   public function get_month_page_views($month_num$total false$column){
    $pm = (int) date('n'strtotime($month_num));
    $pmy = (int) date('Y'strtotime($month_num)); 
    if ($total == 'true'){
    $query $this->db->get();
    if ($total == 'true'){
    return $query->row();
    } else {
    return $query->result();    

This is the error that I am getting

Quote:Error Number: 1140

In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column ''; this is incompatible with sql_mode=only_full_group_by

SELECT *, SUM(`page_hits`) AS `page_hits` FROM `analytics_page_views` WHERE MONTH(date) = 2 AND YEAR(date) = 2017

Filename: C:/wamp/www/system/database/DB_driver.php

Line Number: 691

Can anyone help please with understanding this error?

I had the same issue, see the following answer for a well-put explanation:
I have been looking at this post but I just cannot understand what it really means and how I can fix it Sad