PCHomepage
Programmer
How can I get the row number in a list of entries? It's not the number of rows in the result that I need: it is a line by line count of each one.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
That's what I thought. I'm trying to create a function to provide the row number when run inside a loop so how would I do it? I'm not sure where to begin.
$rowNumber = 1;
while($row=mysqli_fetch_row($result))
{
[indent]echo $rowNumber . $row['fieldname'];[/indent]
$rowNumber++;
}