Vigilant Psyche Posted May 17, 2008 Share Posted May 17, 2008 Hey. Is there a way to pull MySQL values out of a database and then write them in real time with javascript? Ie if a value in the database is changed it would change on the page without having to refresh? Thanks for any ideas! Quote Link to comment Share on other sites More sharing options...
947740 Posted May 18, 2008 Share Posted May 18, 2008 You could use a combination of AJAX and PHP...I think. Quote Link to comment Share on other sites More sharing options...
Psycho Posted May 18, 2008 Share Posted May 18, 2008 AJAX is the key. However there is no way to have the page automatically refresh when a record is updated. Your only option would be to set a javascript timer on the page to check for new data every n seconds. Quote Link to comment Share on other sites More sharing options...
Vigilant Psyche Posted May 18, 2008 Author Share Posted May 18, 2008 The page would have to refresh? Would this not take quite a long time? Quote Link to comment Share on other sites More sharing options...
Psycho Posted May 18, 2008 Share Posted May 18, 2008 The page would have to refresh? Would this not take quite a long time? Well, I technically misspoke there. The "page" doesn't have to refresh, but the database changes would. AJAX allows you to update part of a page without refreshing the page. How long it takes will depend on many factors. How did you expect JS to update the page with new records without getting new data? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.