Actually the proper code using the modulo looks something like this;
echo "<table border=1><tr><th>First name</th><th>Last name</th><th>Phone</th></tr>";
$count=1;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if($count%2){
//Here's a row
echo "<tr><td>{$row['first']}</td>";
echo "<td>{$row['last']}</td>";
echo "<td>{$row['phone']}</td></tr>";
$count++;
}
else{
//Here's a highlighted row
echo "<tr bgcolor=lightgrey><td>{$row['first']}</td>";
echo "<td>{$row['last']}</td>";
echo "<td>{$row['phone']}</td></tr>";
$count++;
}
}
echo "</table>";
the modulo already looks for a result of 0 so ==0 is not necessary as shown below
if($int_count%2==0)
// should be
if($int_count%2)
The example I gave with
if($count&1)
basically shifts the count bitwise for every other row and I learned it here in these forums, however the modulo %2 or %3 or any other number will work if you want to alternate for every two or three rows or ever how many rows that you wish, but it is more efficient to just use the bitwise operator in this case.
This is why I love these forums because you see different ways of doing the same thing that might be much better and that is what this forum is all about in my mind as feeble and old as it might be. The only reason I copied and pasted transfield's was to make it easier on him so I used HTML twice (basically the same code but with a <tr bgcolor=color>) so he could now take both the post thaat you made and mine and learn even more.