title: How to auto refresh div contents contain php variables?
body: <p>I created a page named <code>queries.php</code></p>
  
  <pre><code>&lt;?php
  require("connection.inc.php");
  $query = "SELECT SUM(john), SUM(robert), COUNT(school) FROM election";
  $result = mysql_db_query($db, $query, $connection) or
  die("query error!");
  
  $data = mysql_fetch_array($result);
  $john = number_format($data[0], 0,',','.');     
  $robert = number_format($data[1], 0,',','.');
  $school = $data[2];
  $total = $john + $robert;
  $remaining_school = 524 - $school;
  $percentage_john = round(($john*100/$total),2);
  $percentage_robert = round(($robert*100/$total),2);
  ?&gt;
  </code></pre>
  
  <p>Then I display the data in <code>display.php</code>
  The data displayed well and nothing error, I tried a couple of tricks to auto refresh the container using jquery but failed.
  Here is my <code>display.php</code> page:</p>
  
  <pre><code>&lt;?php
  include("queries.php");
  ?&gt;
  
  &lt;div id="totaljohn"&gt; // &lt;--- the div id taken from css layout
  &lt;h9&gt;John: &lt;?php echo $john; ?&gt; &lt;br&gt; (&lt;?php echo $percentage_john; ?&gt; %)&lt;/h9&gt;
  &lt;/div&gt;
  
  &lt;div id="totalrobert"&gt;
  &lt;h9&gt;Robert: &lt;?php echo $robert; ?&gt;&lt;br&gt; (&lt;?php echo $percentage_robert; ?&gt; %)&lt;/h9&gt;
  &lt;/div&gt;
  
  &lt;div id="totalboth"&gt;
  &lt;h4&gt;Total : &lt;?php echo $total; ?&gt; Suara&lt;/h4&gt;
  &lt;/div&gt;
  
  &lt;div id="totalschool"&gt;
  &lt;h4&gt;Total School attending : &lt;?php echo $school; ?&gt; Schools&lt;/h4&gt;
  &lt;/div&gt;
  
  &lt;div id="remaining_schools"&gt;
  &lt;h4&gt;Remaining Schools: &lt;?php echo $remaining_school; ?&gt; of 524 schools&lt;/h4&gt;
  &lt;/div&gt; 
  </code></pre>