亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP development enterprise website tutorial: delete administrator

In fact, deletion is the simplest one

On the display page, we already know that deleting the administrator link to deluser.php

Let’s take a look at the code for deleting the page

<?php
    //刪除管理員部分代碼
    require_once('conn.php');
    $id = $_GET['id'];
    $sql = "DELETE from user where id='$id'";
    $res = mysql_query($sql);
    if($res){
        echo "<script>alert('刪除管理員成功');location.href='user.php'</script>";
    }else{
        echo "<script>alert('刪除管理員失敗');location.href='user.php'</script>";
    }
?>

First connect to the database and then get the parameter id brought over and delete it based on the id

With the above code, we have completed the deletion function

Continuing Learning
||
<?php //刪除管理員部分代碼 require_once('conn.php'); $id = $_GET['id']; $sql = "DELETE from user where id='$id'"; $res = mysql_query($sql); if($res){ echo "<script>alert('刪除管理員成功');location.href='user.php'</script>"; }else{ echo "<script>alert('刪除管理員失敗');location.href='user.php'</script>"; } ?>
submitReset Code