Crontab a PHP script updates MySQL and sends mail
Hi all,
I have searched in this php forum but found nothing about
this topic. Perhaps it should be a job for Perl or Python
to do. I have no idea so far and need your suggestion.
I want to do two things once a day by using crontab in linux.
1. UPDATE table1 SET flag=1 WHERE flag=0 AND endtime_ts>time()
2. Send e-Mail to those users with flag=2 and update_ts is today
The crontab will be run on the server. The easiest way i can
figure out is to write the script in PHP. Then write a bash
script to trigger this PHP script. Finally crontab this bash
script for once a day.
Do you have any better way other than mine? It is ok that you
teach me a Perl solution. But please write in very detail so
that i can understand :)
with best wishes
sandy