title: Live update MySQL Data
body: <p>I have the following code and it works great, I just want to convert it to live so it updates every 10 seconds or so without a page refresh, I'm guessing I'll need to use AJAX or Jquery but I lack the knowledge on how to do so.</p>
  
  <pre><code>=====VIA &lt;?php include("database.php"); ?&gt;====
  &lt;?php
  // Create connection
  $con=mysqli_connect("ip/host","user","pass","db");
  // Check connection
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  ?&gt;
  
  ====ON THE PAGE====
  &lt;? php
  
  $result = mysqli_query($con, "SELECT * FROM sql347511.1 ORDER BY ID DESC LIMIT 1;");
  
  while ($row = mysqli_fetch_array($result)) {
      echo "&lt;div class='infobox_data'&gt;Temperature: ".$row['TEMP']."&amp;deg;C&lt;/div&gt;";
      echo "&lt;div class='infobox_data'&gt;Humidity: ".$row['HUMID']."%&lt;/div&gt;";
      echo "&lt;div class='infobox_time'&gt;Captured: ".date("g:i:s a F j, Y ", strtotime($row["TIME"]))."&lt;/div&gt;";
  }
  
  mysqli_close($con); ?&gt;
  </code></pre>