Hitman
11-06-2009, 07:28 PM
Howdy. Basically this is annoying me now... I'm making a leader board. It uses a mysql query to get the top 10 highest scores and then display them in a table... I'm stuck at displaying them all.
I can get the first one, but the rest are the same as the first... I've looked on google but I can't find it... it needs to loop or whatever, but I'm not too sure how.
$get = mysql_query("SELECT * FROM `users` ORDER BY `cash` DESC LIMIT 0 , 10 ");
$get = mysql_fetch_array($get);
echo "<table width=\"200\" border=\"1\">
<tr>
<td>".$get['username']."</td>
<td>".$get['cash']."</td>
</tr>
</table>";
If somebody could post a code so that it could loop it and display all 10 I'd be grateful.
Thanks.
I can get the first one, but the rest are the same as the first... I've looked on google but I can't find it... it needs to loop or whatever, but I'm not too sure how.
$get = mysql_query("SELECT * FROM `users` ORDER BY `cash` DESC LIMIT 0 , 10 ");
$get = mysql_fetch_array($get);
echo "<table width=\"200\" border=\"1\">
<tr>
<td>".$get['username']."</td>
<td>".$get['cash']."</td>
</tr>
</table>";
If somebody could post a code so that it could loop it and display all 10 I'd be grateful.
Thanks.