Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Tjk is offline
    New Coder
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts

    Actively updating web pages

    Hi. I'm looking to create a page which will update in real time as values in a mysql database change without having to actively refresh the page but I'm not sure which web languages I should look to for this. I've wondered if placing a Java or Flash applet in the page which then runs a query to the database may work.

    I know Java can be used to place a query but it lacks the same dynamic visual creation as Flash offers. Although I'm not sure how to have it constantly querying the database.

    Using Flash I know I could export any form data by using getURL and linking to a php processing script but I'm still not sure on what other language I'd need to use to actively update the page with the changing mysql row values... it's on a Linux server so no ASP here. Any ideas on the language to do this?

    With both I'm still unsure if they have the option to keep a constant connection open to the mysql database detecting a change in the database values. Is this actually possible?

    The other part of this is the actual server side processing. At the moment I'm using CRON to constantly reload a PHP script which updates all the mysql values in real time. I could use PHP Forking which seems a very attractive option or I could create a PERL server process. Which one would be more efficient?

    Any comments on any part of this problem will be appreciated. Hopefully I can piece together all the advice I can get from you gurus and start heading in the right direction.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,096 Times in 1,087 Posts
    Chatrooms that use MySQL, use Javascripting to refresh the pages.
    I'm not sure if that's the best way, but that's what they do.
    If people have javascripting turned off, I guess they can't use chatrooms.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Thanked 0 Times in 0 Posts
    I have been thinking along similar lines although not using MySQL,
    I have a background process (cron) that writes the data to .js files
    I am thinking I can have the main page that refreshes itself thus
    including the new data and updates elements on the display page
    (child window) using javascript. This is not exactly event driven
    (changes in the data change the page) but it does emulate it.
    In this way everything except the cron is done client side..
    To be honest I am not certain it will work as i want
    and i may need to use cookies to store user preferences..

    The only real data-driven applications I have seen are written in java.
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.

  • #4
    Join Date
    Jul 2006
    Thanked 0 Times in 0 Posts
    Yes, If the users turn off the java script, they cannot use chatrooms.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts