I am doing a high scores page for user to accumulate their score. Under the database table there are username
, score
and difflevel
(the difficulty level).
Username would be what they use to login and attempt the quiz, score would be how much marks they received from the questions.
My question is how do you add up the database values, for example, "Tom scored 5 points from the quiz today, and he scored 3 points the next day, I want the accumulated sum of 5+3=8. However in the database is his entry of 5 and 3 only.
Currently, I can only display the top scorers but the high score is not cumulative.
Is it possible to add them up(making them cumulative) and display it on the web page? I need this information because I want to show the top 5 scorers of the month or year.