//my php code
$ppnum=$_POST['pnum'];
while ($ppnum !== null)) {
$con=mysqli_connect("","","","");
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con,"DELETE FROM tbldd WHERE pnum ='$ppnum'");
mysqli_close($con);}
答案 0 :(得分:0)
也许你想要这个?假设$ _POST ['pnum']是逗号分隔的ID列表。
$ppnum=$_POST['pnum'];
$con=mysqli_connect("","","","");
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con,"DELETE FROM tbldd WHERE pnum in ($ppnum)");
mysqli_close($con);
但你必须检查$ _POST ['pnum']对抗sql注入攻击。