-
Update the php-page when the database changes
Hello!
I'm building a web based application with php and sql that basicly keeps track of how many rooms that are vacant in a hospital. The idea is that the application could work in realtime, i.e update the page on its own as fast as a room gets vacant.
Is this possible, or is it better to script an "auto update" of the page efter two minutes or so?
Thanks,
-
Hi,
if this is a display for the hospital management, updating the display at intervals should be sufficient. If this is the "booking application" as well, the act of booking could update the display
Musicman
-
But is it possible that the client's page updates if the dababase has been changed?
-
Hi,
it is easier for the client to regularly request updates, than for the application to push updates. In particular, it can be done by a regular webserver
Musicman
-
If you have a server then you could probably make a socket script to accomplish this "real time" effectiveness.
however, in my opinion , i think it would be more reliable to just run request a php script every X amount of seconds.
----
not many web hosts allow sockets to be run properly , so unless you have your own server or are paying for a dedicated one that allows this. your stuck with using the polling method.
Freelance: AS2, AS3, PHP, MySQL, JavaScript
Skype: hunty93
-
It's trivial to have it appear 'real time' by having javascript on the page request the current status and re-display a portion of the page (a div, for example) using your standard AJAX methods. That's probably your best bet.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|