From d6d0d0edbe0fc4b8f135bb5ac990e33fbe61b7c1 Mon Sep 17 00:00:00 2001 From: Harald Ponce de Leon Date: Sun, 20 Nov 2016 13:54:41 +0100 Subject: [PATCH] remove group by as it's not needed and mysql does not return 0 on "select count(*) .. group by .." when no records exist. (fix #509) --- catalog/admin/geo_zones.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/admin/geo_zones.php b/catalog/admin/geo_zones.php index 3143bd974..12c6b13c5 100644 --- a/catalog/admin/geo_zones.php +++ b/catalog/admin/geo_zones.php @@ -224,7 +224,7 @@ function update_zone(theForm) { while ($Qzones->fetch()) { if ((!isset($_GET['zID']) || (isset($_GET['zID']) && ((int)$_GET['zID'] === $Qzones->valueInt('geo_zone_id')))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) { - $Qtotal = $OSCOM_Db->prepare('select count(*) as num_zones from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id group by geo_zone_id'); + $Qtotal = $OSCOM_Db->prepare('select count(*) as num_zones from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id'); $Qtotal->bindInt(':geo_zone_id', $Qzones->valueInt('geo_zone_id')); $Qtotal->execute();