Skip to content

Commit

Permalink
PDO's bindParam() the variable variable is an pass-by-reference one h…
Browse files Browse the repository at this point in the history
…ence you cannot use a function result directly (PHP 5.4 fix)
  • Loading branch information
spotweb committed Apr 1, 2012
1 parent 483f88f commit 4ab7831
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dbeng/dbeng_pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public function prepareSql($s, $p) {
switch ($m) {
case '%d': {
# We convet explicitly to strval because PDO changes a zero to an ''
$stmt->bindParam($idx, strval($p[$idx-1]), PDO::PARAM_INT);
$tmpVal = strval($p[$idx-1]);
$stmt->bindParam($idx, $tmpVal, PDO::PARAM_INT);
break;
}
case "'%b'": {
Expand Down

0 comments on commit 4ab7831

Please sign in to comment.