- php
- $arr=$_POST["item"];
- $db=newmysqli("localhost","root","12345678","heiheihei");
- //foreach($arr as $v)
- //{
- // $sql = "delete from contacts WHERE id='{$v}'";
- // $db->query($sql);
- //}
- $str=implode("','",$arr);//拼接字符,
- $sql= "delete from contacts WHERE id in('{$str}')";
- //2','8','4
- if($db->query($sql))//判断是否查询成功,
- {
- header("location:shouye.php");
- //成功就跳转
- }
- >
来源: http://www.cnblogs.com/xuan584521/p/6440471.html