Php uses checkbox to delete multiple records at a time. A simple example shows a student information database. you need to delete multiple records at a time to create a file named del. php. the code for copying the file is as follows: formaction a simple example
There is an existing student information database, and multiple records need to be deleted at one time
Create a file named del. php
The code is as follows:
The code is as follows:
This file is mainly used to display and display data in the database.
Create a file named SC. php with the following 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 information deleted ";
}
}
Mysql_close ();
?>
Use the foreach method to delete records respectively.
Pipeline has a student information database. you need to delete multiple records at a time to create a file named del. php. the code is as follows: form action = "...