开发者

User-specific timer actions in a MySQL database

I have a database full of users and each user has timestamps for a specific events they've executed. I would like to fire off an action for each individual user based on their timestamps. So for example: user1 hasn't logged in for 5 days, send her an email or put her user status to "idle" mode.

What would b开发者_JS百科e the best way about doing this?


I don't know if it's the best way but usually you setup cron jobs to that kind of things.

Your cron job would be a simple PHP script, it would query the database to find all the users that the system should process and send emails etc ...

If you are on windows the scheduled task should be a drop in replacement for cron jobs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜