I'm looking for some guidance on how to use mysql BEGIN, ROLLBACK and COMMITS. I have situations where i am making 2 or 3 updates to tables in seperate queries and if one fails i want them all rolled back. Can someone help me with the following:
Whats the difference between BEGIN and START TRANSACTION?
How can I best incorporate error handling eg. at present i'm running queries using the following code:
$result = mysql_query($query) OR die('Cannot perform query!'.mysql_error());
On a die statement does mysql look back for a BEGIN or START TRANSACTION and roll back to there or will I have to tell it to ROLLBACK?
I'm running mysql 5 on my own machine installed myself - but i'll be deploying the app to a shared hosting site again mysql 5. Is the shared site likely to have innoDb installed? I believe a "SHOW ENGINES" command on the locally installed instance of mysql 5 will tell me whether I have it.