← CodePrimer
PHP
Intermediate
Database
PDO prepared DELETE
How do I delete a row safely?
Prepared DELETE.
<?php
$stmt = $pdo->prepare('DELETE FROM students WHERE id = ?');
$stmt->execute([$id]);
Notes
Confirm destructive actions in the UI.
Keywords: delete · pdo · prepared
Related
PHP
Embed PHP inside HTML
How do I mix PHP and HTML?
SQL
CREATE DATABASE
How do I create a MySQL database?
PHP
PHP comments
How do I write comments in PHP?
SQL
ALTER TABLE add column
How do I add a column to an existing table?
PHP
PHP variable rules
What are the rules for PHP variables?
SQL
Foreign key relationship
How do I relate posts to users?