title: Fastest way to check for update using PHP,AJAX and MySQL
body: <p>I need to check for updates on a (max) one second interval for updates.</p>
  
  <p>I'm now looking for the fastest way to do that using AJAX for the requests and PHP and MySQL.</p>
  
  <p><strong>Solution 1</strong>
  Every time new data, that needs to be retreived by other clients, is added to the MySQL database a file.txt is updated with 1. AJAX makes a request to a PHP file which will check if file.txt contains a 1 or 0. If it contains a 1 it will get the data from the MySQL database and return it to the client. </p>
  
  <p><strong>Solution 2</strong>
  Every AJAX request calls a PHP file which will check directly into MySQL database for new data. </p>
  
  <p><strong>Solution ..?</strong>
  If there is any faster solution i'd be happy to know! (considering I can only use PHP/MySQL and AJAX)</p>