title: PDO DELETE query Invalid parameter number: parameter was not defined
body: <p>I am having issues getting a PDO prepared <code>DELETE</code> <code>query</code> to work. I am unsure of how I need to structure the <code>bindParam</code> in this instance. I get this warning:</p>
  
  <blockquote>
    <p>Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>if(isset($_POST['delete'])) {
      $id = $_POST['id'];
      $stmt = $dbc-&gt;prepare("DELETE FROM users WHERE id = ?");
      $stmt-&gt;bindParam(' :id', $id);
      $stmt-&gt;execute();
  }
  
  &lt;form method="POST"&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input name="id" value="&lt;?php echo $row['id'];?&gt;" readonly&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input name="first" value="&lt;?php echo $row['first'];?&gt;"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input name="last" value="&lt;?php echo $row['last'];?&gt;"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input name="product" value="&lt;?php echo $row['product'];?&gt;"&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;button name="save" type="submit"&gt;Save&lt;/button&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;button name="delete" type="submit"&gt;Delete&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/form&gt;
  </code></pre>