I have a table which selects the results from a database table, with each record there is a Button echoed (DeleteButton). I would like this delete button to delete THE SELECTED ROw (RECORD). My code is presented below, I have narrowed the issue down the 'id' not being POST/GET correctly. I think the form is not passing the id correctly. Can somebody help?
The Form In A Table Cell:
echo "<td>"
.'
<form id="DeleteUser" action="DeleteUser.php" method"post">
<input type"text" name="id" value=" '.$row['user_id'].' " hidden />
<input type="submit" value="Delete">
</form>
'.
"</td>";
echo '</td>';
The Delete Statement (DeleteUser) (DeleteUser.php) :
<?php
$stmt = $con->prepare("DELETE FROM users WHERE user_id = ?");
$stmt->bind_param('sissi',$_GET['id']);
$stmt->execute();
$stmt->close();
?>