RE: [PHP] save html created by loop in variable
| From: | Jason Dulberg | Date: | Thu, 18 Apr 2002 04:27:22 +0000 |
| Subject: | RE: [PHP] save html created by loop in variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93478@lists.php.net to get a copy of this message | ||
Thanks for your reply... I just tried it with ob_start(); and I think I'm
almost on the right track. Just one small issue. Since the records are in a
while loop, the results are printed line by line as expected. However, I
need to print something obtained from the sql query just once then the rest
to loop.
//a.agentname displays only once and h.title/h.address will be in a list
SELECT h.title, h.address, a.agentname FROM homes h, agents a WHERE
h.owner=a.id AND a.id=$aid
Basically what I'm after is displaying something like:
Agent: Fred
nice house, 123 street
ugly house, 643 road
Thanks again for your help on this.
Jason
> -----Original Message-----
> From: Miguel Cruz [mailto:mnc@stoic.net]
> Sent: April 17, 2002 8:28 PM
> To: Jason Dulberg
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] save html created by loop in variable
>
>
> On Wed, 17 Apr 2002, Jason Dulberg wrote:
> > I have a WHILE loop that I am interested in storing the html that is
> > generated based on its results to a variable. This variable
> would then be
> > echoed later on.
>
> Check in the manual under Output Buffering.
>
> miguel
>
>