Q:

creating a top list in PHP

So my brain is having trouble functionning this morning and I can't figure out how to create a Top list.
I have my query like so
 $moyennepisode = $conn->prepare('SELECT * FROM show_moyenne, shows WHERE shows.id = show_moyenne.show_id ORDER BY moyenne DESC LIMIT 100');
 $moyennepisode->execute();

  while  ($show = $moyennepisode->fetch()) { 
somecode }

Which is all fine but I simply want to output the position so I tried a for loop but I can't seem to figure out where to place it. I tried an associate array but I failed at that, too.
Can anyone recommend how to do that ? And if there might be a way to do have the position from mmysql instead of php ?
Any help appreciated. Thanks!

A:

$position = 1; 
while ($show = $moyennepisode->fetch()) { 
    Output $position;
    $position++;
    somecode;
}

