Reputation: 139
So, I have a forum and I want to reward users who donated automatically with a special membergoup, I can do this by adding it into forum's MySQL database. What I need now is to remove such usergroup when a month has passed, automatically. What I would like to know is if it would be possible to make it purely on PHP for example, or another similar alternative.
Thanks in advance
Upvotes: 0
Views: 1276
Reputation: 593
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.
Upvotes: 1
Reputation: 360862
php has no job scheduling mechanism built into it, unless you run a script as a daemon. MySQL has its own scheduling mechanism: http://dev.mysql.com/doc/refman/5.1/en/events-overview.html
Upvotes: 5