Results 1 to 6 of 6
Thread: Get 50 before an after my rank?
Sep 1, 2012, 08:26 #1
- Join Date
- Dec 2005
- 0 Post(s)
- 0 Thread(s)
Get 50 before an after my rank?
I'm trying to create a rankingf list with 100 (101) listed users depending on the current users rank. So if the user is rank 257 I would like to list the 50 higher ranked than him and the 50 lower ranked than him but not sure how to go about this. I get the current users rank like this:
$sql = mysql_query("SELECT COUNT(*) rank FROM ".$prefix."_users WHERE points > (SELECT points FROM ".$prefix."_users WHERE id = $playerid) AND played > 0") or die(mysql_error());
$row = mysql_fetch_assoc($sql);
$rank = $row['rank']+1;
$sql = "SELECT * FROM nf_users WHERE played > 0 ORDER BY points DESC LIMIT 100";