$vrow = 1; $query = mysql_query("SELECT * FROM TABLE"); while($data = mysql_fetch_array($query)){ if($vrow==1){ $crow="#393939"; $vrow=0; }else{ $crow="#414141"; $vrow=1; } }
$query = mysql_query("SELECT * FROM TABLE"); $i = 1; echo '<table>'; while($data = mysql_fetch_array($query)){ $color = "#393939"; if($i % 2 == 0){ $color = "#414141"; } echo '<tr>'; echo '<td bgcolor="'.$color.'">'; var_dump($data); echo '</td>'; echo'</tr>'; $i++; } echo '</table>';