???? ?? ??
?? ?? ??? ?? ?? ?? ??? ??? ?????
<?php <a href="typesave.php?action=del&id=<?php echo $row['id']?>">刪除</a> <a href="javascript:delall()">全部刪除</a><a href="typeadd.php"> 添加類別</a>
get ??? ?? ?? ?? typasave.php ????? ?????
typeave.php ???? ?? ??? ?????:
elseif ($_GET["action"]=="del"){ $id=$_GET['id']; $sql = "delete from type where id=$id"; if ($mysqli->query($sql)) { echo "<script>alert('類別刪除成功')</script>"; echo "<script>window.location='typelist.php'</script>"; } }elseif ($_GET["action"]=="delall"){ $arrid=$_GET["arrid"]; $arr=rtrim($arrid,","); $sql="delete from type where id in ($arr)"; $result=$mysqli->query($sql); if($result){ echo "<script>alert('類別刪除成功!')</script>"; echo "<script>window.location.href='typelist.php'</script>"; }
?? ??: