View Full Version : results in 2 colors
HormonX
11-30-2002, 08:30 PM
here is the deal .. am not to sure how to acomplish this. My goal is this .. when user does a search .. the results are going to be displayed in rows and they will alterate ...one rows background for example will be white next will be silver ... and so on ...
can anyone help?
thanx :)
Spookster
11-30-2002, 09:51 PM
Set some kind of flag variable:
$colorflag = 1;
while ($rows = mysql_fetch_array($result)){
if($colorflag == 1){
$color = "#FFFFFF";
$colorflag = 2;
}
else if($colorflag == 2){
$color = "#000000";
$colorflag = 1;
}
echo("<tr><td bgcolor=" . $color . ">" . $rows[1] . "</td></tr>");
}
HormonX
11-30-2002, 11:33 PM
thanx :)
works just great
HormonX
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.