I have a MySQL query that pulls about a hundred lines. Right now I'm using HTML TABLES to make everything look neat. What I want to do is ALTERNATE background colors for each line.
this is what I have:
$col1 = "FF0000";
$col2 = "0000FF";
$col = 1;
while ($record = mysql_fetch_row($result))
{
if ($col = 1)
{
echo "<TR BGCOLOR=\"#$col1\">";
$col = 2;
}
else
{
echo "<TR BGCOLOR=\"#$col2\">";
$col = 1;
}
for ($i=0; $i<count($record); $i++)
{
echo "<TD>".$record[$i]."</TD>";
}
echo "</TR>";
}
It will NOT go to the ELSE statement.....anyone know why?
THANKS!!!!