0

Is there a tutorial out there which shows you how to refresh a DIV upon a MySQL change? Like to show only the MySQL records above a certain timestamp and/or ID?

2
  • You'll have to poll the db at regular intervals. However, beware that polling solutions scale very poorly, so make the interval long enough. Commented Mar 23, 2011 at 16:40
  • Alternative to what Marco said would be to catch all changes to the database in your application and have your UI driven by that. It is like going from accessing your class members directly to having setters/getters (always a good idea) Commented Mar 23, 2011 at 16:48

1 Answer 1

1

I agree with the comments. But, you can try to experiment an event-driven server side technology. For example, node.js (based on websockets).

Your client stays listening till an event occurs (database insert), and then, you can reload your div.

This is theory, but I'm sure you can do it this way.

But, as Marco said it, the best way is to set intervals to your refresh (poll method).

Regards.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.