I have been looking for two days now and still haven't found the answer. Suppose I have underneath code in PHP:
$mysqli->begin_transaction();
mysqli_query($mysqli, "DELETE FROM Test WHERE ID=1");
mysqli_query($mysqli, "DELETE FROM TEST WHEREE ID=2"); <-- THIS ONE WILL FAIL BECAUSE OF TYPO
mysqli_query($mysqli, "DELETE FROM Test WHERE ID=3");
if ($mysqli->commit()) {
//SUCCESS
}
else {
//Failed
$mysqli->rollback();
}
I am not able to check whether the queries within the transaction all have succeeded, because when I execute these queries, the commit function always returns true.
How can I check whether all queries within the transaction have succeeded?