add a number in while loop
- by Luke
if ($num_rows > 0)
{
while($row=mysql_fetch_assoc($res))
{
$fromuser=$row['username'];
$comment=$row['comment'];
$commentdate=$row['date'];
$date=strtotime($commentdate);
$final_date=date("g:i a", $date);
$final_date2=date("F j Y", $date);
?>
<table align="center" width="100%"style='border-top: 1px dotted;'bgcolor="#eeeeee" >
<tr><td><?echo "<a href=\"userprofile.php?user=$fromuser\"><b>$fromuser</b></a> commented:\n";?></td></tr>
<tr><td><?echo "at $final_date on $final_date2\n";?></td></tr>
<tr bgcolor="#ffffff"><td><?echo "$comment\n";?></td></tr>
</table><br>
<?
}
}
else
{
echo"There are currently no comments on this user";
}
?>
I am looking for a way to add a number to each comment. So 1, 2, 3, 4, etc in DESC order.
I can't think how I can do this?