Why this update query only update one record once

前端 未结 3 1496
执笔经年
执笔经年 2021-01-19 06:17
$coll->update(
  array(
    \"uid\"=(int)$uid,
    \"status\"=>1,
    \"time\"=>array(\'$gt\'=>0,\'$lte\'=>$time)
  ),
  array(
    \'$set\'=>array         


        
3条回答
  •  抹茶落季
    2021-01-19 06:34

    Seeing as this was done in PHP initially, this may be of use to anyone using PHP:

    $collection->update(
    
        array("uid"=>(int)$uid,"status"=>1,"time"=>array('$gt'=>0,'$lte'=>$time)), //search criteria
    
        array('$set'=>array('status'=>0)), //update criteria
    
        array('multiple'=>true) //options
    
    );
    

提交回复
热议问题