search

Home  >  Q&A  >  body text

php如何批量修改某一字段的值?

烟雨江南烟雨江南2982 days ago1144

reply all(1)I'll reply

  • 迷茫

    迷茫2017-03-13 09:32:28

    where in 不能直接传数组的

    $arr=[33, 64, 89, 128];
    
    echo $sql="update table set `column`='value' where id in ('".implode("','",$arr)."');";
    // update table set `column`='value' where id in ('33','64','89','128');

    reply
    0
  • Cancelreply