A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Update the php-page when the database changes

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    63

    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,

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    63
    But is it possible that the client's page updates if the dababase has been changed?

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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

  5. #5
    Programmer
    Join Date
    Aug 2007
    Posts
    173
    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

  6. #6
    Network Guy
    Join Date
    Nov 2004
    Posts
    36
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center