Home>Article>Backend Development> How to delete data in php
How to delete data in php: 1. Create a PHP sample file; 2. Connect to the database; 3. Delete the data with the specified id through the "delete from news where id = $id" statement.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
How to delete data with php?
php implements basic data addition, deletion and modification operations to delete data
Delete information based on id value delete.php
alert("删除成功"); location.href="//m.sbmmt.com/m/faq/list.php";'; }else { echo '删除失败'.mysql_error($conn); } echo '返回'; ?>
Recommended learning: "PHP video tutorial》
The above is the detailed content of How to delete data in php. For more information, please follow other related articles on the PHP Chinese website!