wtfsmd Posted December 8, 2007 Share Posted December 8, 2007 I need a little help figuring out how to display a number on the side of my query results starting with 1 and ending with *, basically showing how many results were found example: 1 Apples 2 Oranges 3 Pears 4 Bananas and i don't want it to be the id because when i sort them i don't want it to look like: 2 Oranges 1 Apples 4 Bananas 3 Pears but rather: 1 oranges 2 Apples 3 Bananas 4 Pears Basically it will be in no particular order just the number of results. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 8, 2007 Share Posted December 8, 2007 Like this <?php $num = 1; while ($row = mysql_fetch_assoc($query)){ echo $num.' '.$row['col'].'<br>'; $num++; } ?> Quote Link to comment Share on other sites More sharing options...
wtfsmd Posted December 8, 2007 Author Share Posted December 8, 2007 Thanks worked like a charm. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.