Deleting Records from the Database
Learn how to delete records from the database using PHP PDO.
We'll cover the following...
In this lesson, we’ll learn about the different phases of deleting records from the database. We’ll see how we can prepare queries, bind parameters, define bound values, and execute queries.
Step 1: Write and prepare the query
Write the delete statement:
$sql = "DELETE FROM `users` WHERE `id`=:id";
Prepare the query:
...