so I have in my website a table of clients with several columns such as name, age, etc, etc... and I have added a new column which is "Delete" and I added checkboxes, and there's also a button, what I want to do is, if I select one or more checkboxes, and then click on the button to delete, I want them to be deleted off the website but then on the database I want to a field to be updated from 0 to 1 whereas 0 means the client exists on both website and database and 1 means that it no longer exists on the website but it still exists on database.
I'm new in the area of programming but this is the code I got so far:
$id = $_POST['id'];
if(isset($_POST['option']) == 'check' && ($_POST['button']) == 'submit') {
$query = "UPDATE commande
SET traiter = 1
WHERE id = '%$id%'";
var_dump($query);
}
Now this doesn't work, he is not doing the update correctly, I select the checkbox and then click on the button and it doesn't delete from the website nor updates the database specific field from the right client based on its' id, and I have no idea why!
Can anyone help me out here please?
LIKEsyntax in a simple comparison. Remove the percent signs afterWHERE. Also: obligatory Bobby Tables reference.