From: miqrogroove <miqrogroove@gmail.com>
Date: Thu, 21 Jun 2018 15:42:43 +0000 (-0400)
Subject: Allow for Integer Literals in PDO Database Driver
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=759dfe6bb1b03a80ebabe92d89eb55ab3081abad;p=friendica.git

Allow for Integer Literals in PDO Database Driver

This should fix things like "LIMIT ?"
---

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()) {