I have a page on which I want to print all the values in my database table. To make it a bit more readable, I want to add a counter in front of each record. The code I have until now is like this:
while (($row = mysql_fetch_row($result)) AND ($result > 0))
echo"$row[1] - $row[2] - $row[3]<BR>";
mysql_close($connection);
Now I thought that adding a counter here would go something like this:
$i=1;
while (($row = mysql_fetch_row($result)) AND ($result > 0))
echo"$i - $row[1] - $row[2] - $row[3]<BR>";
$i++;
mysql_close($connection);
But what I get to see is:
1 - xxxx- yyyy - zzzz
1 - aaaa - bbb- cccc
1 - dddd - eee - ffff
It looks like the counter is always 1, even though I thought I raised it by one??