?? ??? ???? PHP ?? ?? ?? ???
Create
index.php ???? ?? ??? ??????
<a href='javascript:void(0);' onclick='doDel({$row['id']})'> ;?? </a> ='action.php?action=del&id='+id;
?????????????}</script>
?? ??
?????? ?? ? ?? ID ?? ?? ????? ??? ??
??? ??? ????
<?php header("content-type:text/html;charset=utf8"); $id = $_GET['id']; $conn=mysqli_connect("localhost","root","root","study"); mysqli_set_charset($conn,"utf8"); $sql = "delete from stu where id='$id'"; $rw = mysqli_query($conn,$sql); if ($rw > 0){ echo "<script>alter('刪除成功');</script>"; }else{ echo "<script>alter('刪除失敗');</script>"; } header('Location: index.php'); ?>
??? ?? ?? ??? ?? ????? ??? ? ????
.