heaps21
08-10-2004, 12:40 AM
Hi, I recently posted a similar question in the php forum but have since been told it is a mysql question so here goes...
When a save button is clicked on my web page there are inserts to many different tables that need to take place. I was told (by raf) that wrapping all the sql commands in a transatcion will ensure that either all or none of the commands are completed, which is exactly what i need.
Being relatively new to mysql (i.e. only really knowing about select, insert, update etc) I have struggled to find a simple example of how to use this, and any requirements for using it. I had a look on the mysql manual but didn't really understand it.
So, my question is, can anyone provide a simple example of its use that I can adapt for my needs?
Any help would be much appreciated.
Andy.
When a save button is clicked on my web page there are inserts to many different tables that need to take place. I was told (by raf) that wrapping all the sql commands in a transatcion will ensure that either all or none of the commands are completed, which is exactly what i need.
Being relatively new to mysql (i.e. only really knowing about select, insert, update etc) I have struggled to find a simple example of how to use this, and any requirements for using it. I had a look on the mysql manual but didn't really understand it.
So, my question is, can anyone provide a simple example of its use that I can adapt for my needs?
Any help would be much appreciated.
Andy.