PHP Basic Tutorial
Deleting data in a MySQL table using PHP involves executing an SQL DELETE query. You can either use the procedural or object-oriented approach for interacting with the database.
DELETE FROM table_name WHERE condition;
The following example updates the name
and age
of the user with id=1
.
Note
Without a WHERE
clause, all records in the table would be deleted. Make sure to specify which row(s) you want to delete.