Delete:
1. Home
add <td><a href= ' dele.php?id={$i in foreach[0]}' > delete </a></td>
add $sql = "select * From Student.student WHERE is_delete = 0 "; < Span style= "color: #660000;" > (used when the second method is modified)
2. Create a new dele.php database delete
<?Php$id = $_get[‘Id‘]; $db =New Mysqli ("localhost","Root","Root","Student");//1// $sql = "Delete from student.student WHERE sno = {$id}"; Span style= "color: #008000;" >//if ($db->query ($sql)) {// header ("location:crud.php"); //}; //2$SQL2 = "update Student Set is_delete = ' 1 ' WHERE Sno = {$id} ;< Span style= "color: #0000ff;" >if ($db->query ($sql 2)) {header (location:crud.php ");}
Two ways to delete
1, directly delete 2, modify the database Is_delete Click Delete inside the 0 changes to 1, but need to add in the home page only show the database Is_delete 0 of the data
Test it.
1, click Delete Try this line 1213 Diiudiudiu 1960-08-20 00:00:00 576685
2. Display
3. Successful ^-^
PHP connection to MySQL database for additional pruning--delete