02-14-2019, 02:04 PM
After $db->update you can do something like this:
if(!$db->error()) {
#no error happened
} else {
#an error happened, you can find out what by dumping error or errorString(), eg:
dump($db->errorString());
#I prefer to log my errors, if this is a logged in page:
logger($user->data()->id,"Log Type","Error updating RTU Name, Error: ".$db->errorString());
}
I wrote this without an editor so there could be errors. Furthermore you can verify, if no errors, the count of rows updated with $db->count();
Hopefully this helps.
if(!$db->error()) {
#no error happened
} else {
#an error happened, you can find out what by dumping error or errorString(), eg:
dump($db->errorString());
#I prefer to log my errors, if this is a logged in page:
logger($user->data()->id,"Log Type","Error updating RTU Name, Error: ".$db->errorString());
}
I wrote this without an editor so there could be errors. Furthermore you can verify, if no errors, the count of rows updated with $db->count();
Hopefully this helps.