If a PHP function alters a number of things. Ie. updates a database, copys a picture, makes a thumbnail and so on.
If the function fails half way what is the best way to undo what is already done? so that the change isnt half implemented.
for each "Step" make an undo action that does just the opposite... then use error catching to have it execute each undo previous to the failure
cool, thanks. I had thought something along those lines. but I was just wanted to get some advice to check i was taking the most sensible and effective approach.
Thanks