Hi,
My situation is i need to update 4 tables upon a request.
I execute four statements like a delete two inserts and one update.
What if in any given time after executing two queries the database fails or for any other reason the code exits (probably of any sort of db error/exception).
If that happens then many reference would get wrong and oops :-(. Data will be totally wrong and will have incomplete references.
Is there an option like executing many sql statements in a one shot like multiple insert into statement?
Or if there is a commit mechanism(even if there one i have to learn it to use in mysql) ?
so, at any point i dont want an invalid entry to take place.
for example...
// start save point
// execute all four statements one by one
// at this line commit
I am using codeigniter framework.
I would like to have any kind of reply to this. (suggestions/comments/answers).
Thank you.