I have a mysql database that consists of users. In that database, there is a "score" column. I want to make a profile for the users, but it will show their rank. I don't want to do this server-sided, so i'm trying to do it from the profile page itself. This is my current code:
$sql3 = mysql_query("SELECT * FROM members ORDER BY score DESC") or die("Could not allocate information!");
$rank = 0;
while(mysql_fetch_assoc($sql3)){
$rank++;
}
echo "<b>Rank: </b>#$rank<br/>";
Ive also tried:
$sql3 = mysql_query("SELECT * FROM members ORDER BY score DESC") or die("Could not allocate information!");
$rank = 0;
while(mysql_fetch_assoc($sql3)){
$rank++;
echo "<b>Rank: </b>#$rank<br/>";
}
Either way out, every user has the same rank, #2. Is there any way for me to do this? And if you need more information, please just comment, don't down-rep me. Thanks.