From f662afa7624524f57d27f1b425ec8e44981f79d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Mar 2022 13:37:33 +0100 Subject: [PATCH] Fix sql syntax --- htdocs/core/customreports.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 4ded4498add..030762fd0aa 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -278,7 +278,7 @@ if (is_array($search_groupby) && count($search_groupby)) { $sql = "SELECT DISTINCT ".$fieldtocount." as val"; if (strpos($fieldtocount, 'te.') === 0) { - $sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.'_extrafields as te'; + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element."_extrafields as te"; } else { $tabletouse = $object->table_element; $tablealiastouse = 't'; @@ -287,7 +287,7 @@ if (is_array($search_groupby) && count($search_groupby)) { $tabletouse = $arrayofgroupby[$gval]['table']; $tablealiastouse = $tmpval[0]; } - $sql .= ' FROM '.MAIN_DB_PREFIX.$tabletouse.' as '.$tablealiastouse; + $sql .= " FROM ".MAIN_DB_PREFIX.$tabletouse." as ".$tablealiastouse; } // Add the where here @@ -303,7 +303,7 @@ if (is_array($search_groupby) && count($search_groupby)) { } }*/ - $sql .= ' LIMIT '.($MAXUNIQUEVALFORGROUP + 1); + $sql .= " LIMIT ".((int) ($MAXUNIQUEVALFORGROUP + 1)); //print $sql; $resql = $db->query($sql);