In this tutorial you will learn how to create your own Highscores for your games, using your own free server / database. Let's go! Here's an example of how the...
Is there anyway for me to change the code so that is will give you the lowest scores as my game doesn't have a score but rather a speed run clock that goes up the longer you take to finish. So my "high scores" need to be the ones with the lowest values can you help me at all with where and what in the code I need to change?
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