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 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.
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
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['id'];//获取要删除的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!