> On Fri, 25 Jun 2004 09:07:16 -0500, Stephen Craton > <[EMAIL PROTECTED]> wrote: >> >> What I'm basically trying to do is make the database display out the >> information from it's tables as soon as it possibly can without the need >> for >> refreshing. For example: >> >> Someone enters in some text, and it's put into the database. As soon as >> possible, the text is shown in a page that wasn't refreshed and has been >> shown at all times, on several computers. They don't all have to be >> synchronized, just that it shows as soon as it possibly can without >> refreshing. >> >> This may be an HTTP push method, the name sounds similar to what I'm >> trying >> to do. What exactly is it and how do you utilize it? > > Let me say this very clearly. Getting the data to the user *as soon > as* it's entered into the DB is impossible unless you: > > 1) Have a PHP script which never ends and is constantly asking the DB > for more data (this is very server resource intensive and it a *bad > idea*) > 2) Write a client program that does *not* rely on the web browser. You > can use Java to make it load in the browser, but then it wouldn't be > PHP. > > IMHO, your *only* bet to do this elegantly *with* PHP is to use some > JS. Have a hidden iframe that the JS reloads every x seconds. The JS > reads the data in the iframe and outputs new data to the user's > screen. The user's page itself will never refresh. >
As far as I know, you can't stream data into a database. It takes it all in with the INSERT command (or whatever database you use). For security reasons, streaming data into a database would be bad. You better check all those statements before they're entered into the database or else risk having the DB/server taken hostage or corrupted. Any activity taken on the client's browser without a refresh would require a language such as Javascript. But Javascript is CSI and won't insert data into your database. You need an SSI like PHP do to that. The PUSH thing you're referring to? Are you talking about the PSH flag in TCP? PUSH is a transport-layer protocal. HTTP only has GET and POST (as well as OPTION,HEAD,PUT,DELETE,TRACE and CONNECT) which are application-layered. --Matthew Sims --<http://killermookie.org> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php