Creating your own Leaderboard / Highscores Easy and Free (PHP & MySQL) [UPDATED 2020]

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
  • Thanks for this super clear tutorial! I like your idea about separating the scores by 'level' or by 'difficulty' (easy, medium, hard). Do you have a tutorial for this? Thanks alot!!!!

    • First, your scores table must have a new column. So you have: name, score AND level/difficulty.

      Then, when submitting score to savescores.php, you already sent name & score. Now you must also add the new variable: level/difficulty.

      Last, when getting scores with getscores.php, let's say you will read only scores for level 2 or difficulty easy.

      You can send a variable level/difficulty from the game to getscores.php. Edit the getscores.php PHP file to read from the Database only the scores with the requested level/difficulty.