sh0wtym3 Posted January 6, 2009 Share Posted January 6, 2009 Hey all, Seemingly simply question, I want to take the results I get from the query below: //Show the database results $query = "SELECT * FROM mail"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "{$row['fname']} {$row['lname']}<br>" . "<b>{$row['email']}</b><br><br>"; } ... and number them. For example: 1. fname lname email 2. fname lname email 3. fname lname email Can somebody please point me in the right direction? Normally I'd google it, but I'm not even sure what this function is called. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/139684-solved-counting-your-search-results/ Share on other sites More sharing options...
Zhadus Posted January 6, 2009 Share Posted January 6, 2009 For future reference, it is HTML. Ordered listing. //Show the database results echo "<ol>"; $query = "SELECT * FROM mail"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "<li>{$row['fname']} {$row['lname']}<br>" . "<b>{$row['email']}</b></li>"; } echo "</ol>"; Link to comment https://forums.phpfreaks.com/topic/139684-solved-counting-your-search-results/#findComment-730846 Share on other sites More sharing options...
sh0wtym3 Posted January 6, 2009 Author Share Posted January 6, 2009 Sweet, it works. Thanks. Link to comment https://forums.phpfreaks.com/topic/139684-solved-counting-your-search-results/#findComment-730850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.