Home >Backend Development >PHP Tutorial >make me cry make me smile MySQL record deletion operation code using PHP
First, we create a new data display page view.php:
Copy the code The code is as follows:
$link=mysql_connect("localhost","root","administrator password");
mysql_select_db("infosystem", $link);
$q = "SELECT * FROM info";
mysql_query("SET NAMES GB2312");
$rs = mysql_query($q, $link);
echo "
Department name | Employee name | PC name |
del< /td> | $row->depart | $row->ename |
Copy the code The code is as follows:
$link =mysql_connect("localhost","root","administrator password");
mysql_select_db( "infosystem", $link);
$del_id=$_GET["id"];
$exec="delete from info where id=$del_id";
mysql_query($exec, $link);
echo "Delete successfully !";
mysql_close($link);
?>
The above introduces the make me cry make me smile MySQL record deletion operation code using PHP, including the content of make me cry make me smile. I hope it will be helpful to friends who are interested in PHP tutorials.