PHP: how can I know the number of the current row I'm reading from the result of a...

aoc10010001100

New member
...MySQL query? For example... I have the following code...
while ($row = mysql_fetch_assoc($result))
{
echo '-'.row['name'].'<br>';
}

how can I put the number of the row of that result before every id so it looks something like this...?
1-Peter
2-Marcus
3-William
etc...

I tried with the variable $result but it gives me the number of the last row in every line. What variable will give me the number of the current row from the result it's reading?
 
Back
Top