blueman378 Posted June 8, 2008 Share Posted June 8, 2008 hi guys, im creating sort of a competition thing, and i have a table with id || username || score but what im wanting to do is rank the players by thier score, so say there are nine people with scores of 1 || a || 356 2 || b || 312 3 || c || 300 4 || d || 300 5 || e || 295 6 || f || 356 7 || g || 313 8 || h || 299 9 || i || 192 so if i asked what place player: C came you would get: 5 because the ranking is: 1st || a || 356 1st || f || 356 3rd || g || 313 4th || b || 312 5th || c || 300 5th || d || 300 7th || h || 299 8th || e || 295 9th || i || 192 anyy idea how i would do this? jsut looking for a starter thanks Link to comment https://forums.phpfreaks.com/topic/109237-how-far-in/ Share on other sites More sharing options...
Barand Posted June 8, 2008 Share Posted June 8, 2008 SELECT COUNT(*)+1 as place FROM scores WHERE score > (SELECT score FROM scores WHERE username='c') Link to comment https://forums.phpfreaks.com/topic/109237-how-far-in/#findComment-560356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.