This code works just fine, but I don't understand how it works. It's to make every other table row on my search results page alternate colors. I guess I don't understand how $color is assigned 0 or 1.
$result = mysql_query($sql,$connection) or die("Couldn't execute query.");
$cellcolor = array('blue','red');
$color = 0;
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$location = $row['location'];
if ("0"==$color){$color="1";}
else {$color="0";}
$display_block .= "
<TR BGCOLOR=$cellcolor[$color]><TD>