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:
Normally I get the top 100 out of my list 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;
Any ideas how to do this? Thanks in advance :-)
$sql = "SELECT * FROM nf_users WHERE played > 0 ORDER BY points DESC LIMIT 100";