本文操作环境:windows7系统、PHP7.1版、DELL G3电脑php怎么实现删除数据?php实现基本数据增删改操作之删除数据根据id值删除信息 delete.php<?php // header('Conte
本文操作环境:windows7系统、PHP7.1版、DELL G3电脑
php怎么实现删除数据?
php实现基本数据增删改操作之删除数据
根据id值删除信息 delete.php
<?php
// header('Content-type:text/html;charset=utf-8');
// $conn = @Mysqli_connect('localhost','root','123456','itsource');
include('./conn.php');
$id = $_GET['id'];
// echo $title.$autor.$source.$content;
$sql = "delete from news where id = $id";
$res = mysqli_query($conn,$sql);
if($res)
{
echo '<script>alert("删除成功"); location.href="list.php";</script>';
}else {
echo '删除失败'.mysql_error($conn);
}
echo '<a href="list.php">返回</a>';
?>
--结束END--
本文标题: php怎么实现删除数据
本文链接: https://www.lsjlt.com/news/550.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-28
2023-09-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0