Jump to content

Numbered results


CanMan2004

Recommended Posts

Hi all

I have a quick question.

I have a bit of php code which looks like;

<?
while($rows = mysql_fetch_array($result))
{
print $rows['title'];
print "<br>";
}
?>

This outputs 3 words currently

Welcome
Happen
Switch

Is there a way to put a number before each result, so it would look like

1: Welcome
2: Happen
3: Switch

So it puts numbers before each result, numbers should run from 1 upwards, for example, a large result would be

1: Welcome
2: Happen
3: Switch
4: Holiday
5: Water
6: Always
7: Pool

Can this be done?

Any help would be ace

Thanks in advance

Dave
Link to comment
https://forums.phpfreaks.com/topic/30229-numbered-results/
Share on other sites

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.