0

I've been doing some research and have not found a complete answer if I can use mysqli_multi_query that may contain both Updates/Deletes, while using mysql_rollback in the event that one of the queries fails. Does anyone know if this can be done? If so, any simple example I could build off of?

The only examples and information I have seen is simple query by query with auto commit disabled, then committing at the end, with the option of rollback in the event of an issue.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • 1
    With questions like these I would just setup a simple db, create some queries, run them with the mysql_multi_query function (offcourse add 1 query that doesn't work) and then try rolling back the changes. Also you are talking about mysqli in the first function and mysql in the second one. – Jordy Mar 06 '15 at 14:30
  • Sorry, should have been mysqli_rollback. Yeah, I was thinking that as well, I will likely do that in a bit, was hoping for some insight before I did. Thanks – Dennis Hepworth Mar 06 '15 at 14:34
  • @DennisHepworth This should explain it a bit further for you http://stackoverflow.com/questions/17649926/how-does-mysqlicommit-mysqlirollback-work – Jordy Mar 06 '15 at 14:39

0 Answers0