Delete Data from Table using PDO
How to delete data from table using PDO?
The delete statement is used to delete the values from a table.
DELETE FROM tablename [WHERE where_condition];
The Delete statement deletes the rows from table and returns the number of rows deleted. The WHERE clause is used to specify the conditions that identify which rows to be deleted. If the DELETE query contains without WHERE clause, all rows will be deleted.
$sql = "DELETE FROM user_details WHERE firstname.lastname@example.org'";
$count = $conn->exec($sql);
This is example for DELETE query.This query will delete the record of user_details where email@example.com'.Result :