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:
$checkboxes = isset($_POST['option'])? $_POST['option']: array();
foreach($checkboxes as $value){
$query = "UPDATE commande
SET traiter = 1
WHERE id = $value";
mysql_query($query);
var_dump($query);
}
Now when I execute that, the var_dump appears to be correct, the var_dump returns me the expected, but when I check database, I see that it didn't update the field "traiter" to = 1
So I'm kinda confused and lost, anyone can help me out here with this?