verycleanteeth Posted June 20, 2007 Share Posted June 20, 2007 Okay, I wasn't sure whether this should go under the MySQL forum or here, because I'm not sure where the solution lies. Basically I've got a MySQL database with a Users table, and this table has a 'Points' column. I want to find the quickest, most efficient way to determine where this user ranks in relation to other users. Something like 'There are 250 users with more points than you'. Link to comment https://forums.phpfreaks.com/topic/56332-ranking-systems/ Share on other sites More sharing options...
Full-Demon Posted June 20, 2007 Share Posted June 20, 2007 Well, you could sort the MySQL output asc/desc for the points column, in the query itself. Than search for the value in the array, and return the array ID (ie 250). Not sure, perhaps better ways to do it, thats how I should do it. FD Link to comment https://forums.phpfreaks.com/topic/56332-ranking-systems/#findComment-278300 Share on other sites More sharing options...
verycleanteeth Posted June 20, 2007 Author Share Posted June 20, 2007 Wouldn't you have to retrieve all the rows to do that though? Link to comment https://forums.phpfreaks.com/topic/56332-ranking-systems/#findComment-278681 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.