force php script to start over if it fails
Posted: Sun Aug 16, 2009 11:21 pm
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?