Basically, I am trying to create some sort of ‘high score’ – I will have to gather all users’ total experience, and total level information from the database, but I want to add a temporary MySQL column to the query (which will be an integer), so I can know right away what their ranking is.
Here is my query so far:
SELECT characters_statistics.total_level,
characters_statistics.total_exp,
characters.username
FROM characters_statistics
INNER JOIN characters ON characters.id = characters_statistics.master_id
ORDER BY total_exp DESC
Try this: