Montagna, Dan <mailto:[EMAIL PROTECTED]>
on Thursday, April 15, 2004 1:02 PM said:
> Hi everyone,
hi.
> for($i = 0; $i < $numofrows; $i++) {
> $row = mysql_fetch_array($result); //get a row from our result set
> if($i % 2) { //this means if there is a remainder
> echo "<TR bgcolor=\"yellow\">\n";
> } else { //if there isn't a remainder we will do the else
> echo "<TR bgcolor=\"white\">\n";
> }
> echo
>
"<TD>".$row['name']."</TD><TD>".$row['phonenumber']."</TD><TD>".$row['ag
e'].
> "</TD>\n";
> echo "</TR>\n";
> }
<?php
for($i = 0; $i < $numofrows; $i++)
{
...
$row_color = ($i % 2 == 0) ? "yellow" : "white" ;
echo "<tr bgcolor=\"$row_color\">\n";
...
}
?>
hth,
chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php