0

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

2
  • 1
    run the script yourself (or get another site with cron to open the script page). Or when a user logs in, check their status and update accordingly Commented Sep 10, 2012 at 15:43
  • Is there any specific reason you can't use a cron job? That really would be the best solution... Commented Sep 10, 2012 at 15:44

2 Answers 2

5

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.