title: PHP update form using mysqli wont update
body: <p>I have 2 pages. One with my results from the msql database on one which has a update from and sql query on. i have made a button so that it gets the ID of that field when trying to update but when i enter information and submit nothing happens it just seems to refresh the page. </p>
  
  <pre><code>&lt;?php
  
  $db_host = '';
  $db_user = '';
  $db_pass = '';
  $db_name = '';
  
  
  $con = new mysqli($db_host, $db_user, $db_pass, $db_name);
    ?&gt;
  &lt;html&gt;
  &lt;form method="post" &gt;
  &lt;input type="hidden" name="id" value="&lt;?php echo $row['ID']?&gt;"&gt;
  &lt;tr&gt;        
    &lt;td&gt;Title&lt;/td&gt;
  &lt;td&gt;
  &lt;input type="text" name="title" size="20" value="&lt;?php echo $row[title]?&gt;"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Description&lt;/td&gt;
  &lt;td&gt;
  &lt;input type="text" name="description" size="40" value="&lt;?php echo $row[description]?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="right"&gt;
  &lt;input type="submit" name="submit" value="submit"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;/html&gt;
  &lt;?php
  
  if(isset($_POST["submit"])) {
  $id = $_POST['id'];
  $sql = "SELECT * FROM diary";
  $result = mysql_query($sql);
  $row = mysql_fetch_array($result);
  if (isset($_POST[title])){
  $title = mysql_real_escape_string(trim($_POST['title']));
  }else{
  $title = NULL;
  }
  
  if (isset($_POST[description])){
  $description = mysql_real_escape_string(trim($_POST['description']));
  }else{
  $description = NULL;
  }
  
  
  
  
  $query = "UPDATE diary SET title='$title', post='$description' WHERE id= ?";           
   mysql_query($query);
  if ($conn-&gt;query($sql) === TRUE) {
  header("location: results.php");
  } else {
  echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Any help would be greatly appriciated</p>