I'm currently working on building a text-based game. I've been able to create the signup and where the user can pick between three classes. The next part I'm working is on is having a ranking system. The ranking would order the users by username and by highest-lowest experience, based on the user class. I don't have much experience with JOINS and the query is not giving the desired results. Any help would be appreciated.
SELECT ux_users.id, ux_users.username, ux_users_power.experience
FROM ux_users, ux_users_power
WHERE user_class ='ninja'
ORDER BY experience DESC
LIMIT 5
Table One ux_users:
id | username |
------------------------
1 | zak |
2 | mike |
3 | john |
Table Two ux_users_power:
id | experience| user_class
---------------------------------
1 | 22 | Ninja
2 | 01 | Ninja
3 | 34 | Pirate