Commit 666a4e1c authored by Alexander Butenko's avatar Alexander Butenko

replacePlaceHolders: do not replace ? chars in values

parent 44263146
......@@ -667,10 +667,13 @@ class MysqliDb
*/
protected function replacePlaceHolders ($str, $vals) {
$i = 1;
while ($pos = strpos ($str, "?"))
$str = substr ($str, 0, $pos) . $vals[$i++] . substr ($str, $pos + 1);
$newStr = "";
return $str;
while ($pos = strpos ($str, "?")) {
$newStr .= substr ($str, 0, $pos) . $vals[$i++];
$str = substr ($str, $pos + 1);
}
return $newStr;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment