Using error checking to control the path the code takes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Using error checking to control the path the code takes

Post 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
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

Sorry, just bumping this to the front again to see if anyone else has any idea?

Thanks :)

Rob
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

show us some code.
Post Reply