title: Delete button not working in PHP/MySQL
body: <p>My query is not working in <code>deleteartikel.php</code>, it doesn't delete anything out of the database. </p>
  
  <p>In form.php I made a delete button but it doesn't delete the row itself. I can't find the mistake.</p>
  
  <p>form.php</p>
  
  <pre><code> &lt;?php
  include 'dbconnect.php';
  
  $sql = "SELECT * FROM artikel";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
       // output data of each row
       while($row = $result-&gt;fetch_assoc()) {
           echo "&lt;tr&gt;";
           echo "&lt;td&gt;".$row['Productcode']."&lt;/td&gt;";
           echo "&lt;td&gt;".$row['Product']."&lt;/td&gt;";
           echo "&lt;td&gt;".$row['Type']."&lt;/td&gt;";
           echo "&lt;td&gt;".$row['Fabriekcode']."&lt;/td&gt;";
           echo "&lt;td&gt;".$row['Inkoopprijs']."&lt;/td&gt;";
           echo "&lt;td&gt;".$row['Verkoopprijs']."&lt;/td&gt;";
           echo "&lt;td&gt;&lt;form action='deleteartikel.php' method='post'&gt;
           &lt;input type='submit' name='delete' value='delete'&gt;
           &lt;/form&gt;&lt;/td&gt;";
       }
  } else {
       echo "0 results";
  }
  
  $conn-&gt;close();
  ?&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  
  &lt;!-- Footer navigatie --&gt;
  &lt;footer&gt;&amp;copy;ToolsForEver 2017 alle rechten voorbehouden.&lt;/footer&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>deleteartikel.php</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['delete'])) {
  
  include('dbconnect.php');
  
  $productcode = $_POST['Productcode'];
  
  $conn-&gt;query("DELETE FROM artikel WHERE Productcode = '$productcode'");
  
  header('Location: artikel.php');
  
  }
  ?&gt;
  </code></pre>