Home /mysql /Check for an error in the last mysqli transaction /

Check for an error in the last mysqli transaction

2:17 am, April 23, 2017

Checks if there is an error in the last sql statement and if there is it shows it. were $db is your database connection.

<?php
$db->query($sql);
if(isset($db->error)) {
echo $db->error;
}
?>

query($sql); if(isset($db->error)) { echo $db->error; } ?>