undoing SQL

admin

Administrator
Staff member
The scenario:
After the user clicks on submit from a form, the PHP processes the information, adding, updating, or deleting it from the various tables.

The puzzle:
If at any point during the writing to the tables, an error were to occur, I want all of the actions to be reveresed so that the tables will be in the same condition as they were before the script started.

The reasoning:
I don't want half entered data lying around in my database. Plus, an incomplete write during the signup process could cause the PHP script to think that a specific login or organization name is already in use (when really the rest of the information the form gathers, is not present), thereby stopping that person or organization from trying to resignup after the error has occurred.

My questions:
How are others handling this type of a function? or is this something that is unnecessary?

Your thoughts and advice is appreciated,

Peter Armstrong

P.S. I am using PHP 3.0.12
 
Back
Top