php批量操作数据

时间:2023-01-08 14:54:28
//从分组中删除熊猫 public function panda_del(){
 //var_dump($_POST);die;  $panda=M('chain_panda');


    $where['id']=array('in',$_POST['panda_id']); 
    $data['group_id']=0;
    if($_POST){
        $del=$panda->where($where)->save($data);
        if($del){
            $this->success('移除分组成功');
        }else{
            $this->error('移除分组失败');
        }
    }
 echo '从分组中删除熊猫';
}

  • 批量操作数据