Use JavaScript on the page to periodically make calls to the server and receive some data. Using the jQuery library for cross-browser AJAX support, you simply do the following:
jQuery(function($){
setInterval(function(){
$.get( '/getrows.php', function(newRowCount){
$('#rowcounter').html( newRowCount );
});
},5000);
});
This will make a request to your server every 5 seconds and attach the result to what you send back to the element with the id rowcounter, for example.
<p>There are <span id='rowcounter'>xx</span> rows in the DB.</p>
source
share