Correction GROUP BY uniquement quand des tables à lier

This commit is contained in:
xdrm-brackets 2016-07-25 01:00:53 +02:00
parent 0ae20f3fd1
commit 547fc5449c
1 changed files with 3 additions and 1 deletions

View File

@ -865,7 +865,8 @@
}
/* (4) On rédige la clause GROUP BY */
$requestS['GROUPBY'] = SQLBuilder::GROUPBY($groupBy);
if( count($groupBy) > 0)
$requestS['GROUPBY'] = SQLBuilder::GROUPBY($groupBy);
/* [6] Clause LIMIT
=========================================================*/
@ -880,6 +881,7 @@
/* (2) On compose la requête */
$requestString = SQLBuilder::BUILD($requestS).';';
var_dump($requestString);
/* (3) On prépare la requête */
$request = Database::getPDO()->prepare($requestString);