Delete";"; then create A file named "del.php"; finally write the delete function in the file."/> Delete";"; then create A file named "del.php"; finally write the delete function in the file.">

Home >Backend Development >PHP Problem >How to implement delete button in php

How to implement delete button in php

藏色散人
藏色散人Original
2020-11-23 09:43:063482browse

How to implement the php delete button: First modify the delete code to "echo "Delete";"; Then create a file named "del.php"; finally write the delete function in the file.

How to implement delete button in php

Recommended: "PHP Video Tutorial"

The operating environment of this tutorial: windows7 system , PHP5.6 version, this method is suitable for all brands of computers.

Specific question:

How to implement the delete button after php query results

How to implement delete button in php

Implementation method :

1: This line of code replaces your delete code: echo "Delete ";

2: Create a file named del.php and write the delete function in it

<?php
$id = $_GET[&#39;id&#39;];//获取要删除的ID
//把你的链接数据库代码写这里
$result = mysql_query("delete from sysuser where sysuser_id = {$id}");
if($result){
echo "删除成功";
}else{
echo "删除失败";
}

The above is the detailed content of How to implement delete button in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn