title: How to continuously update a part of the page
body: <p><a href="http://pastebin.com/dttyN3L6" rel="noreferrer">http://pastebin.com/dttyN3L6</a></p>
  
  <p>The file that processes the form is called upload.php</p>
  
  <p>I have never really used jquery/js so I am unsure how I would do this or where I would put the code.</p>
  
  <p>It has something to do with this <code>setInterval (loadLog, 2500);</code></p>
  
  <p>Also, how can I make it so the user can submit a form without the page refreshing?</p>
  
  <pre><code> $.ajax({  
    type: "POST",  
    url: "upload.php",  
    data: dataString,  
    success: function() {  
  
    }  
  });  
  return false;  `
  </code></pre>
  
  <p>and </p>
  
  <pre><code> &lt;?php 
   $conn1 = mysqli_connect('xxx') or die('Error connecting to MySQL server.');
   $sql = "SELECT * from text ORDER BY id DESC LIMIT 1";
   $result = mysqli_query($conn1, $sql) or die('Error querying database.');
   while ($row = mysqli_fetch_array($result)) {
        echo  '&lt;p&gt;' . $row['words'] . '&lt;/p&gt;';
   }
   mysqli_close($conn1);
  
   ?&gt;
  
   &lt;/div&gt;
  
   &lt;?php     
   if (!isset($_SESSION["user_id"])) {
  
   } else {
        require_once('form.php'); 
   }
  
   ?&gt;
  </code></pre>