I\'m pretty new to transactions.
Before, what I was doing was something like:
Code Block 1
$db = new PDO(...); $stmt = $db->prepare(
if you face any error you can do this to rollback all transactions like this
catch(Exception $e){ $db->rollBack(); // Failed, maybe write the error to a txt file or something return false; }