title: PHP won't send the data to my mysql database
body: <p>I'm brand new to PHP and just trying to create a very basic registration form but when I click submit it won't create the data in my database.</p>
  
  <pre><code>&lt;form action"signup.php" method="post"&gt;
    username:&lt;input type="text" name="n"&gt;&lt;br /&gt;
    password:&lt;input type="password" name="p"&gt;&lt;br /&gt;
    id      :&lt;input type="text" name="id"&gt;&lt;br /&gt;
    &lt;input type="submit"&gt;
  &lt;/form&gt;   
  
  
  &lt;?php
  $conn = mysql_connect("localhost", "root", "");
  $db   = mysql_select_db("myth", $conn);
  ?&gt;
  
  &lt;?php
  $user = $_POST['n'];
  $pass = $_POST['p'];
  $id   = $_POST['id'];
  $sql  = "INSERT into phplogin values(" . $id . ",'" . $user . "','" . $pass . "')";
  $query = mysql_query();
  
  if(!$query)
      echo "failed ".mysql_error();
  else           
      echo "successful";
  ?&gt;
  </code></pre>