Automatically generate email on a timer
Hi
Is it possible for a webpage to once a week automatically perform an SQL query and then email the results to me?
I am using PHP and MySQL.
Thanks
this would be a nice idea
anyone got any clues?
This would be a job for CRON.
This thread might give you a head start:
http://www.sitepointforums.com/showt...highlight=cron
I had a good read of that thread. And checked my control panel with my host and it offers crontab.
Well. Could someone explain how cron works cos I am still confused.
Basically I want a page to perform a query on a database once a week then email the results to me. How could I do this, using cron?
Basically, you would just created a file that does your sql query and email -- then set up your crontab to run that file at the specified time/date.
Originally posted by jdulberg
Basically, you would just created a file that does your sql query and email -- then set up your crontab to run that file at the specified time/date.
it didn't appear to offer weekly as an option!?
You can set it to run on particular days of the week - so maybe set it to run at 12am every Sunday
0 0 * * 0 /path/to/file.php
Here's a nice little article that explains various CRON features:
http://www.codingclick.com/article.php/aid/17
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks