Re: Progress bar?
| From: | Jason Lavigne | Date: | Sat, 09 Dec 2000 00:39:50 +0000 |
| Subject: | Re: Progress bar? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29333@lists.php.net to get a copy of this message | ||
If you were to use a streaming HTML window from PHP ( as seen in PHPChat on
http://www.phpwizard.com ) you can keep sending data to the
browser without
reposting ( read about flush() ) to the server. So if you did this you could
do the following in PHP:
Do select from SQL and return Num of rows (use a function that counts the
total number of records from the select) and send that to the browser.
As you process each record you could send back to the browser that you
processed X records. (I would send this update after 10 records or add code
that after each % that was done I send back that number)
At this time the browser has the total number of records and is receiving
the record number that was processed (10 out of 100 etc...)
Then using JavaScript you could feed those values in to DHTML or Flash to
graphically do a status bar.
Is there another solution? I am sure there is, but it is not impossible.
Let me know if you do do this, I would be interested is seeing in working :)
Jay
----- Original Message -----
From: "Miles Thompson" <milesthompson@sprint.ca>
To: "Murph" <murph@murphatnight.com>; "PHP General List"
<php-general@lists.php.net>
Sent: Friday, December 08, 2000 7:25 AM
Subject: Re: [PHP] Progress bar?
> If you did one you'd have to fake it. Think about it, the web is stateless
environment, no channel is opened and maintained to the back end, and SQL
queries are essentially the same. If a progress bar
> displays while a SQL query executes, it's provided by the database vendor.
>
> If you did have feedback from the SQL engine you would need to keep firing
new pages to the browser.
>
> Regards - Miles Thompson
>
> Murph wrote:
>
> > Hi!
> >
> > Has anyone invented a progress bar that displays on a web page to
entertain the viewer while they wait for a query to finish? I'd be
interested in getting a pointer to a snippet of code if you have it.
> >
> > Yours,
> > Murph
> >
> > www.murphatnight.com
> > __________________________________________________________________
> > Brian Murphy - 193A Lowell St., Apt. 24 - Methuen, MA 01844 - (978)
725-6654
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>