Page 1 of 1

Using error checking to control the path the code takes

Posted: Tue Apr 20, 2004 1:38 am
by robster
I hope the subject was discriptive? :)

I have code that does these things:
-Asks for input via a form
-Adds data to a temp table in the database
-Asks for file via a form
-Adds file to a temp folder with a temp name

After user agrees file and text entered is what they want it then:
-Copies file to a new name in a new folder
-Copies data from the temp table in the database to a permanent one


This all works fine but I want error checking just incase the database fails etc. For instance if the database server crashes partway through their upload I would like it to give the error, stop where it's at, then go back to the start of the process again (or an error report page even better).

The same with the natural progession. id:
-If database DIDN'T fail, move on to next step etc
-else go to error report page.

Things like that. Are there built in php or mysql error handling that I can use, is there some other industry standard way to do this perhaps?

Thanks so much for any help or advice you might have :)

Rob

Posted: Tue Apr 20, 2004 4:03 pm
by robster
Sorry, just bumping this to the front again to see if anyone else has any idea?

Thanks :)

Rob

Posted: Tue Apr 20, 2004 4:20 pm
by John Cartwright
show us some code.