summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--E_PDOStatement.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/E_PDOStatement.php b/E_PDOStatement.php
index 8540bdd..87d331f 100644
--- a/E_PDOStatement.php
+++ b/E_PDOStatement.php
@@ -114,10 +114,15 @@ class E_PDOStatement extends \PDOStatement
*/
if (is_array($inputParams) && $inputParams !== array())
{
- foreach ($inputParams as $replValue)
+ ksort($inputParams);
+ foreach ($inputParams as $key => $replValue)
{
- $replValue = $this->_prepareValue($replValue);
- $testQuery = preg_replace("/\?/", $replValue, $testQuery, 1);
+ $key = (is_numeric($key)) ? "\?" : $key;
+
+ $testParam = "/" . $key . "/";
+ $replValue = $this->_prepareValue($replValue);
+
+ $testQuery = preg_replace($testParam, $replValue, $testQuery, 1);
}
}