Originally posted by TYLERofDOOM
.....EDIT: Made with the specifics (I figured you guys are good just not "mind reading" good 🙂 )
well not everyone, but some of us 😉
easiest way is to use a modulus
$i=0;
while($row=mysql_fetch_assoc($result))
{
$color='green';
if ($i % 2 == 0) //% = modulus = remainer of $i/2
$color='blue'
//fill in the rest...
}
so...
0/2 = 0
1/2 = 1
2/2 = 0
3/2 = 1
4/2 = 0... etc etc
see how it works?