删除很简单,我们直接来看代码
<?php require_once('conn.php'); $id = $_GET['id']; $sql="delete from about where id='$id'"; $res = mysql_query($sql); if($res){ echo "<script>alert('删除信息成功');location.href='about.php'</script>"; }else{ echo "<script>alert('删除信息失败');location.href='about.php'</script>"; } ?>
获取删除链接传过来的 id 然后根据 id 进行删除