I use the while loop when grabbing rows from my db.
for ($j = 0; $j < $rows; $j++) {
$RowColor[] = $this->html_get_alt_row_color($j);
}
$rowcount = 0;
while ($row = mysql_fetch_array($result)){
$fileid = $row['id'];
$filename = $row['filename'];
$filetype = $row['filetype'];
$filedesc = $row['description'];
$filesize = $row['filesize'];
echo '<TR BGCOLOR="'.$RowColor[$this->countplus($rowcount)].'">';
echo '<td>'.$fileid.'</td>';
echo '<td>'.$filename.'</td>';
echo '<td>'.$filetype.'</td>';
echo '<td>'.$filedesc.'-'.$rowcount.'</td>';
echo '<td>'.$filesize.'</td>';
echo '<td><a href="getdata.php?id='.$fileid.'" target="_blank">
<img border="0" onMouseOver = "window.defaultStatus = \'\'; window.status = \'Download '.$filedesc.'\' ; return true" alt="Download" src="download.gif">
</a></td>';
echo '</tr>';
}
How can I get each row to have a different background, my current method does not work.