PHP ?? ?? ???? ????: ?? ?? ??
delnews.php ??? ????? ??? ?????
? ??? ??? ???????:
<?php //刪除新聞資訊部分代碼 require_once('conn.php'); $id = $_GET['id']; $sql = "delete from news where id='$id'"; $res = mysql_query($sql); if($res){ echo "<script>alert('刪除成功');location.href='news.php';</script>"; }else{ echo "<script>alert('刪除失敗');location.href='news.php';</script>"; } ?>
??????? ????, ???? ??? ???? ID? ??? ?? ??? SQL ?? ?????
SQL ?? ???? ????? ???? ???? ????? ????? ? ? ??? ????? ???? ?? ?????