A simple example
There is a student information database and multiple records need to be deleted at once
Create a file named del.php
The code is as follows:
Copy code The code is as follows:
This file is mainly used to display and display the data in the database.
Create another file named sc.php with the following code:
Copy the code The code is as follows:
$link=mysql_connect("localhost","root","");
mysql_select_db("zs");
$id=$_POST['de'];
foreach($id as $ide){
$exec="delete from student where sID=$ide";
$result=mysql_query($exec);
if((mysql_affected_rows()== 0) or (mysql_affected_rows==-1))
{
echo "No record found, or an error occurred while deleting";
exit;
}
else{
echo "Student The information has been deleted";
}
}
mysql_close();
?>
Use foreach to delete the records respectively.
http://www.bkjia.com/PHPjc/321221.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321221.htmlTechArticleA simple example: There is a student information database and you need to delete multiple records at one time to create a file named del.php The file code is as follows: Copy the code as follows: form action="...