Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created April 21, 2021 01:51
Show Gist options
  • Save codeforfun-jp/dfc21d379761b534af7be597ef730d82 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/dfc21d379761b534af7be597ef730d82 to your computer and use it in GitHub Desktop.
Save Image File with PHP & MySQL - #5
<?php
require_once 'functions.php';
$pdo = connectDB();
$sql = 'DELETE FROM images WHERE image_id = :image_id';
$stmt = $pdo->prepare($sql);
$stmt->bindValue(':image_id', (int)$_GET['id'], PDO::PARAM_INT);
$stmt->execute();
header('Location:list.php');
exit();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment