how to buffer output

This is a discussion on how to buffer output within the PHP Language forums, part of the PHP Programming Forums category; hi vishal here. can anyone tell me that how to buffer output and then send the output to client at ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-03-2005
vishal
 
Posts: n/a
Default how to buffer output

hi

vishal here. can anyone tell me that how to buffer output and then send
the output to client at a time.

what is my problem is that i have a php file which runs query on
database and takes some time to get query result. so what i want is i
want to buffer output till the query returns result and then send the
buffered output to client at a time.

thxs for help in advance.

Reply With Quote
  #2 (permalink)  
Old 03-03-2005
deresh
 
Posts: n/a
Default Re: how to buffer output

On Thu, 03 Mar 2005 05:17:49 -0800, vishal wrote:

> hi
>
> vishal here. can anyone tell me that how to buffer output and then send
> the output to client at a time.
>
> what is my problem is that i have a php file which runs query on database
> and takes some time to get query result. so what i want is i want to
> buffer output till the query returns result and then send the buffered
> output to client at a time.
>
> thxs for help in advance.


use output buffering:

on the first lin of your script ( the one that does db query) put :
ob_start();

// do your db query
// and setup resulting html
// the normal way (usning echo, print etc..)
// then just call:

ob_end_flush(); // this outputs output buffer and turns off output
buffering




Reply With Quote
  #3 (permalink)  
Old 03-03-2005
Tim Van Wassenhove
 
Posts: n/a
Default Re: how to buffer output

On 2005-03-03, vishal <vishal_panjabi@yahoo.co.in> wrote:
> hi
>
> vishal here. can anyone tell me that how to buffer output and then send
> the output to client at a time.
>
> what is my problem is that i have a php file which runs query on
> database and takes some time to get query result. so what i want is i
> want to buffer output till the query returns result and then send the
> buffered output to client at a time.
>


read the fine manual.... http://www.php.net/ob_start and others.....

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0