How often do you use transactions?
Posted: Sat Aug 29, 2009 12:00 pm
I just recently discovered MySQL transactions, and thought to MySelf: "How could I have not known about this? How often do developers use this?". So now I ask you, how often do you take advantage of the transaction feature in MySQL? Would you say it's a must for multiple queries that should all execute successfully?
Now that I've asked that, I have some other questions regarding transactions. If you're interfacing with the MySQL via PHP, would the following script be the way to go about using transactions?
Would all the queries between the "START TRANSACTION" query and the "COMMIT" query be apart of the transaction?
Now that I've asked that, I have some other questions regarding transactions. If you're interfacing with the MySQL via PHP, would the following script be the way to go about using transactions?
Code: Select all
mysql_query("START TRANSACTION");
mysql_query("...");
...
mysql_query("COMMIT");