Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ezSQL Transaction (MySQLi)
// begin the transaction
$db->query('BEGIN');
// run all of your queries here...
// commit the queries
if($db->query('COMMIT') !== false) {
// transaction was successful
} else {
// transaction failed, rollback
$db->query('ROLLBACK');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment