so I might have one user (user a) with 12 rows, another (user b) with 4 rows, another (user c) with 3 rows and finally another (user d) with 1 row.
I was able to get it working, but I'm a bit baffled as to why it does work...I did something like this:
Code: Select all
$color = TRUE;
$user = "";
while($row = mysql_fetch_assoc($result)){
if($user !== $row['user'])
$color = !$color;
echo ($color ? "blue" : "red");
}why does my first comparison result in true? I'm assuming that php has something built in to ignore empty strings when using !== as a comparison? Perhaps if I used !=, I'd get the result I expected? I would try it, but I'm home now and am too lazy to recreate it here, I'll try tomorrow at work.
if someone can shed some light as to why this DOES indeed work, I'd most greatly appreciate it.
thx,
Burr