From 5aa1839bfbd82782d1cf6511d99f24a6e8c3da69 Mon Sep 17 00:00:00 2001 From: Alex Trofimov Date: Fri, 15 Sep 2017 11:27:37 +0600 Subject: [PATCH] #875 Problem with binding numeroc only values in LIMIT clause --- inc/classes/BxDolDb.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/inc/classes/BxDolDb.php b/inc/classes/BxDolDb.php index a34b0e78eb..29991994f9 100644 --- a/inc/classes/BxDolDb.php +++ b/inc/classes/BxDolDb.php @@ -1016,14 +1016,17 @@ protected function executeStatement($oStatement, $aBindings = array(), $bVerbose { $bResult = false; - foreach($aBindings as $sKey => $mixedValue) { - if(is_null($mixedValue)) - $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_NULL); - else if(is_numeric($mixedValue)) - $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_INT); - else - $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_STR); - } + if (!isset($aBindings[0])) { + foreach($aBindings as $sKey => $mixedValue) { + if(is_null($mixedValue)) + $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_NULL); + else if(is_numeric($mixedValue)) + $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_INT); + else + $oStatement->bindValue(":{$sKey}", $mixedValue, PDO::PARAM_STR); + } + $aBindings = array(); + } switch (self::$_rLink->getAttribute(PDO::ATTR_ERRMODE)) { case PDO::ERRMODE_SILENT: