title: Auto refresh included PHP file inside a DIV
body: <p>I have a file called messages.php which runs SQL queries to a database and displays results in a <code>$res</code> variable</p>
  
  <p>My menu.php page I used</p>
  
  <pre><code>include 'messages.php';
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>&lt;div id="msgs"&gt;
  &lt;?php echo $res; ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So this displays all the data in the <code>$res</code> variable from the messages.php page in a div on menu.php</p>
  
  <p>How can i make this automatically refresh so any new data in the <code>$res</code> variable displays without having to refresh the menu.php page?</p>