ex01b delete:
<?php
header ( "Content-type: text/html; charset=utf-8" ); //设置文件编码格式
include_once('conn.php');
$name=$_GET['name'];
$sqlstr1 = "delete from phpstu where name = '{$name}'"; //定义删除语句
$result = mysqli_query($conn,$sqlstr1); //执行删除操作
if($result){
echo "<script>alert('删除成功');history.go(-1);</script>";
}else{
echo "<script>alert('删除失败');history.go(-1);</script>";
}
?>