From 28d493fbb8e2971aff9183f3216518447d99100c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 25 Jul 2016 01:00:53 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20GROUP=20BY=20uniquement=20quand=20?= =?UTF-8?q?des=20tables=20=C3=A0=20lier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/ORM/Rows.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manager/ORM/Rows.php b/manager/ORM/Rows.php index 030288b..9f45d43 100644 --- a/manager/ORM/Rows.php +++ b/manager/ORM/Rows.php @@ -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);