Skip to content

Conversation

@kazimolmez
Copy link
Contributor

Code:

$data   = [
  'name'            => $_GET['name'],
  'fax'             => NULL,
  'updated_on'      => date('Y-m-d H:i:s'),
];
$db->update('restaurant', $data, ['id', '=', 12]);

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

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
@TheTechsTech
Copy link
Contributor

What version PHP you using? Many bugs nowadays needs fixing on different versions, and the Github Actions CI.

@kazimolmez
Copy link
Contributor Author

What version PHP you using? Many bugs nowadays needs fixing on different versions, and the Github Actions CI.

PHP version: 7.4

@TheTechsTech TheTechsTech merged commit f21aeb5 into ezSQL:master Apr 30, 2025
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants