Selecting or deselecting checkboxes and running different queries in PHP
问题 Edited: So, I have multiple checkboxes. My goal is to insert checkbox value in MySQL if is checked, and to delete checkbox value from MySQL if is not checked. Everything works fine except deleting the value. PHP doesn't know which checkboxes are "unchecked". Any idea? So far I have this: if(isset($_POST['values'])) { foreach($_POST['values'] as $checked) { $query5 = (" INSERT INTO ecust_user_contract (fk_contract, fk_cust_user) VALUES ('".$checked."','".$username_u."') "); $result5 = mysqli