WHAT TO DO: Mixing of GROUP columns SQL issue?

Talk and info about common issues

Moderators: ne_moj, zewa

Site Admin
Site Admin
Posts: 5930
Joined: Jan 7th, '09, 23:18

WHAT TO DO: Mixing of GROUP columns SQL issue?

Postby administrator » Feb 3rd, '12, 08:49

If you get following error:

Code: Select all

#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

it means that you have sql_mode set to ONLY_FULL_GROUP_BY

To prevent such errors you may add following line of code

Code: Select all

$result = database_query("SET sql_mode = ''");


Code: Select all

$sql = preg_replace("/SELECT\b/i", "SELECT COUNT(*) as mg_total_records, ", $this->VIEW_MODE_SQL, 1)." ".$this->WHERE_CLAUSE." LIMIT 0, 1";

in include/classes/MicroGrid.class.php file

If all this doesn't help, try another solution:
Find in MicroGrid.class.php file $this->pageSize = 20; and replace it with $this->pageSize = 1000;

Return to “ApPHP MicroCMS {HOW TO}”