PHP? ??? ?? ??? ???? ?? ?? ??? ?? ?? ??? ?????.
?? ?? ? ????? ?? ?? ????? ??? ???? ??? ?? ??? ??? ???????? ???? ??? ?????.
??????? ???? ??? ??? ? ? ????. ???? ??? ???? ???. ??? ????? ???? ?????
????:
??? ??? ? ????? id ??? ???? ??? ?????. table
SQL ?? ??? ????:
<?php $sql = "delete from new where id = '$id'"; ?>
?? ??? ???? ?? delete.php ??:
<?php header("content-type:text/html;charset=utf8"); $link = mysqli_connect('localhost','root','root','test'); mysqli_set_charset($link, "utf8"); if (!$link) { die("連接失敗:".mysqli_connect_error()); } $id = $_GET['id']; $sql = "delete from new where id = '$id'"; //echo $sql; $rel = mysqli_query($link,$sql); if($rel){ echo "<script>alert('刪除成功');window.location.href='list.php'</script>"; }else{ echo "<script>alert('刪除失敗');window.location.href='list.php'</script>"; } ?>