title: jquery - refresh the page when new data stored in to the table across the browser sessions
body: <p>Environment : PHP/MySQL/Jquery <br/></p>
  
  <p>I would like to refresh the page (ex: index.php) when new data stores in to the table (ex : new_entry_table) checking for every one minute. The same page will be opened in many machines(pc-browsers) at a time all should get refresh when new data arises.</p>
  
  <p>using jquery and database check i tried the following:</p>
  
  <pre><code>setInterval(function(){
  $.post("new_data_check.php", function(data) { 
     if(data &gt; 0){ 
         $("#container").fadeOut('fast').load(location.reload());
     } 
     });
     return false;
  },60000);
  </code></pre>
  
  <blockquote>
    <p>new_data_check.php: <br /> : checks
    for new data in the test_db where
    newdata_field=0 ; <br/> : If any new
    data arises echo "1"; And update the
    newdata_field=1; to stop constantly
    refreshing the page. <br/> : else echo
    "0"; <br/> : Just for a trigger</p>
  </blockquote>
  
  <p>So the above jquery code checks new_data_check.php every 1 min for the trigger , if any trigger arises it will refresh the container.But its getting refresh only one opened session other opened sessions(in other browser or other pc) not getting refreshed.</p>
  
  <p>Suggest a better way to do this. Thanks.</p>