我必须将未检查的值和新检查的值删除到数据库中。如何实现这一目标?已经存在的复选框也将再次发布。但如果他们取消选中我需要删除。这是我的以下代码:
$already_exist_category = array("68","70")
$newly_posted_category = array("124","125","68") or array("124","125");
如何更新或删除新发布的id并将其插入表中?
最佳答案
先删除不存在的id,然后插入数据。
delete from table where id not in ($already_exist_category)
insert the new id here.
关于php - 如何使用php删除未选中的值并在数据库中插入选中的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33706083/