title: Delete button for each record. Undefined variable on click? How?
body: <p>My html:</p>
  
  <pre><code>&lt;td&gt;
      &lt;button type="submit" id="delete" name="delete"&gt;Verwijderen&lt;/button&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Every record in my table has this button. I intend to delete the record when the respective button is pressed. Everytime I press this button, this error (<em>Notice: Undefined index: product_nr in C:\xampp\htdocs\FESPHP\delete.php on line 3</em>) appears.</p>
  
  <p>The PHP code:</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['delete'])) {
      $product_nr = mysqli_real_escape_string($con, $_POST['product_nr']);
      $deleteq = 'DELETE FROM products WHERE product_nr = "' . $product_nr . '";';
      echo $deleteq;
      if (!mysqli_connect_errno()){
          if (mysqli_query($con, $deleteq)) {
              echo "Product deleted";
          }
      }
      var_dump($product_nr);
  }
  ?&gt;
  </code></pre>
  
  <p>I seem to need help trying to retrieve the product_nr that belongs to the record I want to delete, but I could also be doing alot of other things wrong. Any tips on the other things are also appreciated.</p>