2021.5.26

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>";
}
?>
posted @ 2021-05-26 23:44  鯨落  阅读(32)  评论(0编辑  收藏  举报