数据的查询,更改首先在这个层处理,处理完再更新到对应的数据库。
注意额外增加锁,或者缓存机制防止缓存击穿,雪崩导致系统崩溃。
mysql数据批量更新update a set b=1 where id in ($ids) and id !=$_GET['id']
update a set b=0 where id not in ($ids) and id !=$_GET['id']
update a set b=1 where id in ($ids) and id !=$_GET['id']update a set b=0 where id not in ($ids) and id !=$_GET['id']
这样应该可以解决你问题,怎么把两条语句合并,我就不清楚了,你查查
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)