Skip to content

Commit bc6e1d0

Browse files
authored
Fix Error: Uncaught TypeError: Argument 1 passed
Fix in error: Fatal error: Uncaught TypeError: Argument 1 passed to ezsql\Database\ez_pdo::escape() must be of the type string, null given, called in /var/www/vendor/ezsql/ezsql/lib/ezQuery.php on line 633 and defined in /var/www/vendor/ezsql/ezsql/lib/Database/ez_pdo.php:173 Stack trace: #0 /var/www/vendor/ezsql/ezsql/lib/ezQuery.php(633): ezsql\Database\ez_pdo->escape(NULL) #1 /var/www/ajax.php(478): ezsql\ezQuery->update('restaurant', Array, Array) #2 {main} thrown in /var/www/vendor/ezsql/ezsql/lib/Database/ez_pdo.php on line 173
1 parent dabd6b8 commit bc6e1d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ezQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ public function update(string $table = null, $keyValue, ...$whereConditions)
622622
$sql = "UPDATE $table SET ";
623623

624624
foreach ($keyValue as $key => $val) {
625-
if (\strtolower($val) == 'null') {
625+
if (is_null($val) || \strtolower($val) == 'null') {
626626
$sql .= "$key = NULL, ";
627627
} elseif (\in_array(\strtolower($val), array('current_timestamp()', 'date()', 'now()'))) {
628628
$sql .= "$key = CURRENT_TIMESTAMP(), ";

0 commit comments

Comments
 (0)