Forum Moderators: coopster

Message Too Old, No Replies

Refreshing webpage when MySQL db has changed

         

drsmith

3:24 pm on Dec 17, 2007 (gmt 0)

10+ Year Member



I am pretty sure there is not a way to directly do this but wanted to throw it out. Basically we have a log (that several users at a time could be looking at), when data is submitted it posts to the MySQL db. Instead of having the page auto-refresh every 2 minutes or so, it would be nice if it would just refresh when a change is detected. This would also cut down on the chances that data is missed due to inopportune refreshing/submitting. Read something about AJAX? Pretty much a novice so any help would be appreciated.

Thanks
DS

Demaestro

3:37 pm on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ajax is the nicest route because no page refresh is called, the data just reloads from an http header request.

Look into it.

There are fully built libraries available.

I use this one with much success. They take care of all the browser compliance and code updates.

Yahoo (YUI)
[developer.yahoo.com...]

cameraman

5:37 pm on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll still have to poll the server for changes, though. About all you could do is increase your polling rate.