Home >Backend Development >PHP Problem >How to write delete statement in php
php delete statement refers to the DELETE statement. The DELETE statement is used to delete rows from the database table, and the DELETE FROM statement is used to delete records from the database table. Its syntax is "DELETE FROM table_nameWHERE some_column=some".
Recommended: "PHP Video Tutorial"
PHP MySQL Delete
DELETE statement is used to delete rows from a database table.
Delete data in the database
The DELETE FROM statement is used to delete records from the database table.
Syntax
DELETE FROM table_nameWHERE some_column = some_value
Note: Please note the WHERE clause in DELETE syntax. The WHERE clause specifies which records need to be deleted. If you want to omit the WHERE clause, all records will be deleted!
In order for PHP to execute the above statement, we must use the mysqli_query() function. This function is used to send a query or command to the MySQL connection.
The above is the detailed content of How to write delete statement in php. For more information, please follow other related articles on the PHP Chinese website!