I would like to be able to press a button on my site that then updates the status field on my Table,
But when i am placing $id = $_POST['id']
it is not finding the ID?
Where if I place $id = 2
It will update like you saw in the GIF,
<?php
include_once 'db.php';
$id = $_POST['id'];
$sql = "UPDATE form SET status='aid' WHERE id = '$id'";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
= Orders.paid.inc.php
while($row = mysqli_fetch_array($sqldata))
{
echo "</thead>";
echo "<tbody>";
echo '<form action="../assets/includes/orders.paid.inc.php" method="post">';
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['diet'];
echo "</td><td>";
echo $row['pers'];
echo "</td><td>";
echo $row['quan'];
echo "</td><td>";
echo $row['address'];
echo "</td><td>";
echo $row['status'];
echo "</td><td>";
echo '<button type="submit" name="submit">Test</button>';
echo "</td><td>";
echo"<button>Canceld</button>";
echo "</td><td>";
echo"<button>Sent</button>";
echo "</form></td><td>";
}
= Partial from Orders.php