From ac45423e46dd12fdd00906e132bbec0d833d6617 Mon Sep 17 00:00:00 2001 From: Jorge Rausell Date: Sun, 28 Jun 2020 11:49:37 +0200 Subject: [PATCH] Remove single quotes on null value Remove single quotes for NULL values on replacePlaceHolders() line 2043. 'NULL' value with quotes generated an error with date field --- MysqliDb.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MysqliDb.php b/MysqliDb.php index 02cf2ec9..7e56c47d 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -2042,6 +2042,9 @@ protected function replacePlaceHolders($str, $vals) } if ($val === null) { $val = 'NULL'; + $newStr .= substr($str, 0, $pos) . $val; + }else{ + $newStr .= substr($str, 0, $pos) . "'" . $val . "'"; } $newStr .= substr($str, 0, $pos) . "'" . $val . "'"; $str = substr($str, $pos + 1);