在php和mysql中通过product_id删除产品

I am trying to delete the product from database by passing id in delete button. Instead of respective product_id, the value is passing like as first product id 1 is deleted and then 2. The product which i want to delete is not passing id for deleting. The form is in post method

<td><?php echo $product['product_id']; ?></td>
<td><?php echo $product['product_name']; ?></td>
<td><?php echo $product['product_category']; ?></td>
<td><?php echo $product['minbid_price']; ?></td>
<td><?php echo $product['end_time']; ?></td>
<input type="hidden" name="product_id" value="<?php echo $product['product_id']; ?>">
<td><button type="submit" name="btn_delete" class="btn btn-danger" value="<?php echo $product['product_id']; ?>">Delete</button></td>
</tr>

The code in delete.php is below which is showing result of the query at the moment.

if(isset($_POST['btn_delete'])){
//Get form data
 $delete_id = $_POST['product_id'];

 echo $delete_id;

I think you should use form tag:

...
<form action="delete.php">
<input type="hidden" name="product_id" value="<?php echo $product['product_id']; ?>">
<td><input type="submit" name="btn_delete" class="btn btn-danger" value="Delete"/></td>
</form>
...

delete.php

if(isset($_POST['product_id'])){
 $delete_id = $_POST['product_id'];

 echo $delete_id;
 }