timmah1 Posted June 17, 2008 Share Posted June 17, 2008 I have a statement that selects everything from the database and lists them in order of money from highest to lowest. How do I put the rank (numbers, 1, 2, 3,..) next to the information? I tried using <ol><li> but that just puts a 1. beside everyone. thanks in advance Link to comment https://forums.phpfreaks.com/topic/110623-list-items-from-mysql-and-rank/ Share on other sites More sharing options...
craygo Posted June 17, 2008 Share Posted June 17, 2008 use a counter $i=1; while($r=mysql_fetch_assoc($result)){ echo $i." ".$r['field1']."<br />\n"; $i++; } Ray Link to comment https://forums.phpfreaks.com/topic/110623-list-items-from-mysql-and-rank/#findComment-567539 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.