I want to create a system on a website that allows users to do some things depending on their ranking. For example, I have a rule for an X rating value:
- 1 message in 3 days
- 10 comments in 1 day
- 20 votes in 2 days
for an evaluation value of Y, the rule may be as follows:
- 3 posts in 1 day
- 50 comments in 1 day
- 30 votes in 1 day
Every night I recount the user ratings, so I know what every user can do. Opportunities are not cumulative or reset at each recount.
Another important thing: the administrator can fill in specific user features at any time.
What is the optimal database structure (MySQL) for what you want?
I can calculate what a specific user has done:
SELECT COUNT(*) FROM posts WHERE UserID=XXX AND DateOfPost >= 'YYY'
SELECT COUNT(*) FROM comments WHERE UserID=XXX AND CommentOfPost >= 'YYY'
?