title: simple delete query using php
body: <p>I am trying to create a delete query from HTML using PHP:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;form method="POST" action="" &gt;
      ID&lt;input type="text" name="x" /&gt;
      &lt;input type="submit"  value="DELETE" name="del"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>&lt;?php
  $connection = mysql_connect("localhost","root","") or die ("Couldn't connect to server");
  $db = mysql_select_db("smap", $connection) or die ("Couldn't select database");
  if(isset($_POST['del'])) {
      $a = $_POST['x'];
      $sql = mysql_query("DELETE syracuseone WHERE ID ='$a'";)
      if(mysql_query($sql)) {
          echo "deleted";
      } else {
          echo "fail";
      } 
  }
  ?&gt;
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>Notice: Undefined index: x   </p>
  </blockquote>
  
  <p>Any assistance from stack?</p>