Reputation: 60
every Monday I need to empty few fields of a MYSQL database I have
Firstly I thought about using a cron job, but my Web Hosting provider (fatcow.com) doesn't support neither SSH or Command Lines into shared servers.
I've also thought about checking the date() to see if it's monday and perform something, but then I need to run that specific page continuously and I've read that it's a problem.
So now I ask you, how can I do this ?
Thanks for answers
Upvotes: 3
Views: 3244
Reputation: 1898
Should be possible to setup some kind of job in mysql itself. Not 100% sure about it, but read up on
CREATE EVENT something ON SCHEDULE
And maybe you find a way to do it from MySQL instead of PHP. Sorry I can't be of more help, just thought you'd might want to check it out
Upvotes: 1
Reputation: 4536
What's the control panel for that host? cPanel? If so, cPanel almost always has a Cron tool under Advanced. Could also potentially do an exec or system command from a php script to set up the Cronjob (unless that's what you mean by not supporting 'command lines').
Upvotes: 0
Reputation: 34632
If your job can reached via a URL, you might try to sign up with a free crontab service like onlinecronjobs.com
Upvotes: 1
Reputation: 3066
If you have access to any other server that will allow to run cron job, you can create a php file there and run your url to be executed from that server. Use curl, wget or streams to do this.
Upvotes: 3
Reputation: 1
If you have access to another server (with ssh) just add a cron job on it that hit your php script once a week. Unfortunately i don't think there is a way to do it directly on your php script.
Upvotes: 0
Reputation: 52397
If you have access to any other servers that do allow cron, since FatCow doesn't, you could make a cron job that calls wget on a php script on your server -- eg wget http://example.com/fake-cron.php
Upvotes: 2