0

所以,我有一个论坛,我想用一个特殊的会员组奖励自动捐款的用户,我可以通过将它添加到论坛的 MySQL 数据库中来做到这一点。我现在需要的是在一个月过去后自动删除这样的用户组。我想知道的是,是否有可能仅在 PHP 或其他类似的替代方案上实现。

提前致谢

4

2 回答 2

5

php 没有内置的作业调度机制,除非您将脚本作为守护进程运行。MySQL有自己的调度机制:http ://dev.mysql.com/doc/refman/5.1/en/events-overview.html

于 2012-09-10T15:43:38.030 回答
1

You could store the date that the donation was made, and then, you could check the difference between that date and the current date.

If the result is > month then the user should not be in that membergroup.

Also, to avoid calculating that difference every single time, you could have an extra field in your database for each user, which would indicate if that user should be considered a donator.

于 2012-09-10T15:59:11.377 回答