Scheduled jobs with PHP?

Wise Guy
Soldato
Joined
23 May 2009
Posts
5,748
I'm building an email alert system where people can choose if they want daily, weekly or monthly updates from a website. What would be the best way to do this?

I suppose a cron job which runs every day and loads a php script which checks the database for which people to send to on that day?

How would you organize the dates and stuff in the db?
 
Dead simple bud, just add a column to your table called alert or something, when the user signs up give him the choice from a drop down menu for the daily, weekly, monthly.

when you do say your daily email alert the query should be something like

Code:
$dailyQuery = "SELECT * FROM yourusertable WHERE alert='daily'";

loop through sending out emails.
 
Back
Top Bottom