表名:ces
id cid name cun1 2 测试 啦啦啦2 2 测试1 啦啦啦3 2 测试2 啦啦啦
表名:cuns
cid title current 2 测试 3
比如我用PHP操作删除ces表id为1的字段,删除后,对cuns表中cid为2的字段的current字段递减
回复讨论(解决方案)
触发器,删除时候执行sql代码,具体怎么写百度下 很多,主要要考虑性能
楼上是一种,
还有一种你同时更新cuns表不就行了?
看你有什么要求
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn