force php script to start over if it fails

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
gth759k
Forum Commoner
Posts: 76
Joined: Mon Jun 15, 2009 3:04 am

force php script to start over if it fails

Post by gth759k »

I have a script that I want to run continuously and I've set the max time limit in my php.ini file to 31556926 seconds (one year) and what it does is update my database based on a bunch of stuff, but sometimes I get ridiculous errors like "Unknown column 'aaid' in where clause" when the script doesn't even have "aaid" in it or sometimes it says "MySQL server went away" and I don't have another computer to run a linux system on. Or I'll have a key field that cuts off input at varchar 767 and if the script tries to insert something longer, but unique, it will fail because the first 767 might still be identical. There aren't any real syntax errors, because it runs fine for a while, but I'd like to go to bed and wake up and it still be running. So I was thinking maybe I could just get the script to start over if it fails. Does anyone know how to make that happen?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: force php script to start over if it fails

Post by aceconcepts »

Do you have any further information about how your script works?
Post Reply