0

In our page we are fetching some data from database and is displaying it in the page.But the data in the database gets updated frequently.Our problem is that we need to refresh the page manually to view the updated data,but we need to refresh the page automatically when any changes is being made to the data being fetched.

JOSE
  • 3
  • 1
  • Possible duplicate of [Reload Page with Javascript after Database changes](http://stackoverflow.com/questions/25720086/reload-page-with-javascript-after-database-changes) – Zze Mar 21 '17 at 04:42

2 Answers2

0

You could use AJAX to poll the server for new data and if there is reload the page.

The server could return the latest ID that it has and if that differs from the latest on the page, reload the page.

paullb
  • 4,293
  • 6
  • 37
  • 65
  • @Darren Yes I have. Which is why I posted an answer. I provided a plan of attack for the problem at hand. – paullb Mar 21 '17 at 01:49
0
<meta http-equiv="refresh" content="3;url=http://www.yourwebpage.com/" />

Where 3 is 3 second .....

Write php code for fetching data on the page and do meta refresh...(Meta refresh is a method of instructing a web browser to automatically refresh the current web page or frame after a given time interval, using an HTML meta element with the http-equiv parameter set to "refresh" and a contentparameter giving the time interval in seconds. It is also possible to instruct the browser to fetch a different URL when the page is refreshed, by including the alternative URL in the content parameter. By setting the refresh time interval to zero (or a very low value), meta refresh can be used as a method of URL redirection.)