Page 1 of 1
PHP in Real Time
Posted: Mon Mar 15, 2004 7:43 pm
by mcfoo
Hi,
I would like to know if anyone had done PHP in real-time?
Meaning that given a web page, any updates to the database would automatically trigger a refresh to the page that i'm viewing...
Is this achievable?
Thanks a million for any help given!
regards,
mcfoo

Posted: Mon Mar 15, 2004 8:41 pm
by coreycollins
I don't know if that is possibable. The best suggestion I would have is to have a refresh timer and have your page refresh every few minutes or seconds.
Corey
http://www.savance.com
http://www.coreycollins.com
Posted: Mon Mar 15, 2004 8:44 pm
by Goowe
As far as I know, it's not possible with PHP alone. Perhaps another user here could help with another language to get it to refresh and check the database constantly... sorry, I don't know much about anything other than PHP and some HTML...

Posted: Mon Mar 15, 2004 8:47 pm
by mcfoo
Hmmmm...
A refresh-timer is not good enough...
It has to be real-time...
Tat's why i'm sourcing for other technologies...
I saw one being done in Java, but i'm unwilling to venture into that area, as PHP is still my core programming skills, not to mention PHP is way faster...
hmmm, have to wait to see if any other PHP gurus reply to this thread... *pray*
Posted: Tue Mar 16, 2004 8:54 am
by Roja
http://code.jenseng.com/jenChat/
Its a php-based real-time chat. While it does use a refresh, it does it in an iframe, which 'hides' the flicker, and effectively makes it completely realtime. Very nifty.
Alternatively, there IS a method involving server-side Javascript for this exact issue, but when I last read it, it was FAR beyond my knowledge, and I can't seem to find the link for it anymore.
Posted: Tue Mar 16, 2004 9:54 am
by penguinboy
This cannot be done with PHP;
PHP is a server side language.
Your only options are: Meta-refresh, javascript.
Posted: Tue Mar 16, 2004 10:12 am
by patrikG
It certainly is possible, but PHP itself cannot and does not monitor the database for updates. It's the database itself that would need to trigger an event-bubble.
MySQL can't do that - but SQLite should be able to as you can have stored procedures that can get "triggered", somewhat like Oracle. Not sure about other open source databases like Postgres.