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'];
这样应该可以解决你问题,怎么把两条语句合并,我就不清楚了,你查查
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'];