Forum Moderators: coopster
// Do the loop
while ($row = mysql_fetch_assoc($result)) {// Toggle the row colour id
$color_id = ($color_id=='#EBEBEB'? '#FFFFFF' : '#EBEBEB');// Set the bar width
$bar_width = (($row['number'] / $total) * 100);
// Format the number
$bar_width = number_format ($bar_width, 0);// Display the rows
echo '<tr><td width="300" valign="top"><p class="text1a">' . $i . '<a href="http://www.domain.com' . $row['page_on'] . '">' . $row['page_on'] . '</a></p></td><td width="60" valign="top"><p class="text1a"><b>' . $row['number'] . '</b></p></td><td width=" " valign="top" bgcolor="' . $color_id . '"><p class="bar"><img src="bar.jpg" height="11" width="' . $bar_width . '%" /></td></tr>';
}
I've included the variable $i at the start of each row of results and I would like this to be 1 on the first row, 2 on the second, and so forth - incrementing with each row so that each row is numbered.
I've tried a few ways without success, and would appreciate a pointer. Many thanks.