<? if($_POST['submit']){ $ids=implode(',',$_POST['ids']); //print_r($ids); $sql="update `table` set `display`='0' where `id` in(".$ids.")"; echo $sql; } ?> <form method="post"> <input type="text" value="1" name="ids[]" /> <input type="text" value="2" name="ids[]" /> <input type="submit" value="submit" name="submit"/> </form>
输出结果:update `table` set `display`='0' where `id` in(1,2dd)
相关: