ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.29k stars 1.35k forks source link

[Error Handler] Uncaught Error: Call to undefined method DB::getLastErrno() #976

Open hippoduck opened 2 years ago

hippoduck commented 2 years ago

When using the example error handler code exactly as it is, the update works, but the error in the title appears. Not sure why this is, all other queries work fine for me, just the error handling has this issue.

$db->where('login', 'admin')->update('users', ['firstName' => 'Jack']);

if ($db->getLastErrno() === 0)
    echo 'Update succesfull';
else
    echo 'Update failed. Error: '. $db->getLastError();