From 759dfe6bb1b03a80ebabe92d89eb55ab3081abad Mon Sep 17 00:00:00 2001 From: miqrogroove Date: Thu, 21 Jun 2018 11:42:43 -0400 Subject: [PATCH] Allow for Integer Literals in PDO Database Driver This should fix things like "LIMIT ?" --- include/dba.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/dba.php b/include/dba.php index c0617af8e8..478a1a10c2 100644 --- a/include/dba.php +++ b/include/dba.php @@ -427,7 +427,12 @@ class dba { } foreach ($args AS $param => $value) { - $stmt->bindParam($param, $args[$param]); + if (is_int($args[$param])) { + $data_type = PDO::PARAM_INT; + } else { + $data_type = PDO::PARAM_STR; + } + $stmt->bindParam($param, $args[$param], $data_type); } if (!$stmt->execute()) {