Re: Table Output Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Micah Stevens <micah@xxxxxxxxxxxxxxxxxx> wrote:
> 
> You don't have to output two rows.. just do this:
> 
> $color = "red"; // init first color.
> while ($row = mysql_fetch_assoc($data)) {
>        if ($color == "red") {
>                $color = "blue";
>        } else {
>                $color = "red";
>        }
>        ?>
>        <tr bgcolor="<?=$color?>"><td>..................</td></tr> 
> 
> <?
> }
> 
> -Micah 

Great, thanks for the help and information.  May I ask, how does PHP 
know to change the color?  What do the "?"'s do in "<?=$color?>"?

Thanks for the help.

Jeff

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux