title: PHP MySQL insert query not working and not displaying any error messages
body: <p>I have verified that that the post method is actually working using an echo to display the variables, but when I use the Insert query below it does not add the row.</p>
  
  <p>Do you have any ideas?</p>
  
  <pre><code>// 1. Create a DB connection
  $connection =  mysql_connect("localhost","root","P@ssword");
  
  if(!$connection){
      die("Database connection failed: " . mysql_error());    
  }
  
  $menu_name = $_POST['menu_name'];
  $position = $_POST['position'];
  $visible = $_POST['visible'];
  
  $query = "INSERT INTO subjects (menu_name, position, visible) VALUES ('{$menu_name}', {$position}, {$visible})";
  
  $result = mysql_query($query, $connection);
  
  if ($result){
      header("Location:staff.php");
      exit;
  } else {
  echo "&lt;p&gt; There was an error when creating the
  subject &lt;/p&gt;";
  "&lt;p&gt;". mysql_error()."&lt;/p&gt;" ;
  
    }
  
  mysql_close($connection);
  </code></pre>