Hi I want to simple add 1,2,3,4,5,6,7,8,9,10 rank.
My Output now gives the following:
USER ID | SCORE
2 | 10242
13231 | 3427
23732 | 3378
24638 | 2934
23468 | 1898
What I try to achieve is:
RANK | USER ID | SCORE
#1 | 2 | 10242
#2 | 13231 | 3427
#3 | 23732 | 3378
#4 | 24638 | 2934
#5 | 23468 | 1898
This is my php:
<?php $result = mysql_query("SELECT * FROM `users_score` ORDER BY `users_score`.`score` DESC LIMIT 0 , 10") or die(mysql_error());
if(mysql_num_rows($result) > 0): ?>
<table>
<tr>
<th style="text-align:left;">ID</th>
<th style="text-align:left;">SCORE</th>
<tr>
<?php while($row = mysql_fetch_assoc($result)): ?>
<tr>
<td><?php echo $row['user_id']; ?></td>
<td style="font-weight: bold; color: #008AFF;"><?php echo $row['score']; ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; ?>
Is there a simple like count function for this?