title: how to do the auto fetch message without reloading the page by using ajax
body: <p>showing messages with:-</p>
  
  <pre><code>$query = "SELECT * FROM `chat` WHERE fromthe = '$email' and tothe='theadmin' UNION ALL SELECT * FROM `chat` WHERE fromthe = 'theadmin' and tothe='$email' order by id desc";
  mysqli_query($con, $query);
  </code></pre>
  
  <p>unreaded message:-</p>
  
  <pre><code>$query = "SELECT status FROM chat WHERE status=0";
  mysqli_query($con, $query);
  </code></pre>
  
  <p><code>status == 0</code>  - <strong>unreaded</strong></p>
  
  <p><code>status == 1</code> - <strong>readed</strong>..</p>
  
  <p>how to do the auto fetch message without reloading the page by using ajax??</p>