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
  • 1 Comments

  • Order by
  • Yes!

    Open 'getscores.php' and replace "ORDER BY score DESC" (scores are ordered DESCending - higher first then lower) with "ORDER BY score ASC" (scores will be ordered ASCending - lowest values first, then higher)

    // Retrieve data from database

    $sql = "SELECT *

    FROM scores

    ORDER BY score DESC // Replace 'DESC' with 'ASC'

    LIMIT 10"; // The 'LIMIT 10' part will only read 10 scores. Feel free to change this value