Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (21 sloc) 750 Bytes
// Include the common file containing the database connection
require "common.php";
try {
// Prepare the statement
$stmt = $dbh->prepare('DELETE FROM makes WHERE id = :id');
// Filter the id which we are GETting from the query string (passed by index.php)
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
// Bind the param into our statement
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
// Execute the statment and get the record
// redirect back to index.php
header("Location: index.php");
$dbh = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
// End of delete.php