PHP development corporate website tutorial - deleting products

Click delete and jump to the delproduct.php page

Let’s take a look at the code of the delproduct.php page:

<?php
    require_once('conn.php');
    $id = $_GET['id'];
    $sql = "DELECT from product where id='$id'";
    $res = mysql_query($sql);
    if($res){
        echo "<script>alert('删除产品成功');location.href='product.php'</script>";
    }else{
        echo "<script>alert('删除产品失败');location.href='product.php'</script>";
    }
?>

Get the parameter id passed by the form and then delete it based on the id

Continuing Learning
||
<?php require_once('conn.php'); $id = $_GET['id']; $sql = "DELECT from product where id='$id'"; $res = mysql_query($sql); if($res){ echo "<script>alert('删除产品成功');location.href='product.php'</script>"; }else{ echo "<script>alert('删除产品失败');location.href='product.php'</script>"; } ?>
submitReset Code