mysql - How to get ranking of specific player? -
i have list of players. players sorted points. i'd know how ranking number of player?
this code far (which doesn't work because seems have bugs):
$rank = mysql_query (set @rank := 0; select *, @rank := @rank + 1 ava_users id = '".$id."' order points desc); $rank_res = mysql_fetch_array($rank);
when try use query error message:
mysql_fetch_array() expects parameter 1 resource, boolean given in /users/***/documents/arcades/arc_development/arc_projects/***/arc_dev_website/arc_offline/includes/profile/profile_main.inc.php
any help, please?
$rank = mysql_query ( "select a.*, ( select count(1) ava_users b (b.points, b.id) >= (a.points, a.id) ) rank ava_users a.`user` = '$id'" );