Implementation of deletion function of news management system developed with PHP
before row['id'];?>">Modify
Delete
As you can see, click delete and jump to the delnew.php page
Note: To delete, we also need to get the id, and then in When querying the database and writing a delete statement, there must be conditions, otherwise you will not know which data to delete.
Flow chart of the delete function:
First of all Connect to the database
header("Content-type: text/html; charset=utf-8");//Set encoding$con =@mysql_connect("localhost","root","root ") or die("Database connection failed");
mysql_select_db('news') or die("The specified database cannot be opened");mysql_query("set names utf8");//Set the database Character set
Then get the id
$res = mysql_query($sql);
if($res){echo "";
}else{
echo ""; }else{ echo ""; } ?>