I have a problem with PHP leaderboard where I need to create a leaderboard for people that are using my program.
The program is sending scores to database and later displaying all game scores for selected player on separate page. Scores are being cleaned from the database after 24 hours. What I need is to use another database (which I already have) in the same php that is used for sending game scores. But instead the new function is supposed to send scores to other database (that one won't clean the scores up).
The function is supposed to add a new line in database only if the user who played doesn't exist. If player exist and the score is sent I'd like the scores to be added to the same column and calculate them (sum).
For example: A player got 10 kills and 10 deaths. He plays new game and his score is 5 kills and 5 deaths. Database would auto-sum that score with previous one which would cause his DB column to change from 10 kills and 10 deaths to 15 kills and 15 deaths (math/sum/added or w/e you call it the 5 kills and 5 deaths). Well so is there a way I can do this? Purpose of the leaderboard is not to show the user's greatest score but his total kills and total deaths from all the time.
Any suggestions?