Re: Re: Table Output Question
| From: | Micah Stevens | Date: | Tue, 15 Nov 2005 02:39:45 +0000 |
| Subject: | Re: Re: Table Output Question | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-40666@lists.php.net to get a copy of this message | ||
Sorry, that's shorthand.. <?=$color?> is the same as:
<? echo $color ?>
<? is the start tag for a php block, ?> is the end tag..
On Monday 14 November 2005 6:26 pm, Jeff Grossman wrote:
> Micah Stevens <micah@raincross-tech.com> 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