I have a situation where i am inserting to two tables from a web form but the first table needs to be inserted to so i can get the PK, then use the PK to insert into the second table. So what I would like to do is rollback the insert operation if there is some error inserting to the first table or vice versa.
This is what i'm thinkin of doin so far:
mysql_query("START TRANSACTION"); if(mysql_query($myquery)) mysql_query("COMMIT"); else mysql_query("ROLLBACK");
Thanks in advance...