I have a while loop and I am trying to associate a number with each line that increments by 1. I am sure this is probably something simple, I am not sure why I am struggling with it. Here is an example of that I have:
<?php
$counter = 1;
if($total_pages > 0){
while($row = mysql_fetch_array($query)){?>
<tr>
<td><?php echo $counter++ ;?></td>
<td>column2</td>
<td>column3</td>
<td>column4</td>
</tr>
<?php
}
}
?>
But it doesn't output anything. I have also tried several other combinations but can't get it to work for some reason.