Hey... I'm searching for results with my sql table and every row has once result. I want the first row to be black the second to be white thrid black ect ect how is this done??
Set a boolean variable, if its true, set it to false and use black. If its false, set it to true and use white.
Heres an example.:
$bg=''; while ($row=mysql_fetch_array($result)) { $bg = ($bg == "#000000" ? "#ffffff" : "#000000"); echo '<tr bgcolor="'.$bg.'"><td>'.$row['field1'].'</td><td>'.$row['field2'].'</td></tr>'; }