Jump to content

[SOLVED] "Counting" your search results.


sh0wtym3

Recommended Posts

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

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.