Php / mysql - I'm building a web application that has “achievements” (a bit like xbox achievements). What is the best way to program this?

I will have achievements like

get 1000 points

Sign in 20 times

complete 2 tasks in 24 hours

etc.

What is the best way to program this? (for example, the logic behind it), it would be nice to check all the possible achievements on each page load)

+3
source share
1 answer

. , , ( ), , , . (, 1 , ) , , , .

, , , , , , , .

, , "", . "", , . , / , . , , . , , , .., , :

SELECT achievement_id
FROM   progress
WHERE  user_id = $user
AND    achievment_time IS NOT NULL

- , , , , , .. - SELECT , , , .

, ( , ), , , . , (, , ), , , , , .

+3

All Articles