I was using mysqli to retrieve a blob image from MySQL, but I've been moving everything over to PDO. As far as I can tell, this should be working. I've searched and searched the forums for the answer, but I can't see why this doesn't work.
// Connection
include 'pdo_db.php';
// Get Image Id for DB Query
$recipe = $_GET['recipe'];
// Execute Query<br>
$query = $db->prepare("SELECT * FROM myrecipes WHERE Id = ?");
$query->execute(array(
"Id" => $recipe
));
// Display Image
$query->bindColumn(1, $image, PDO::PARAM_LOB);
$query->fetch(PDO::FETCH_BOUND);
header("Content-Type: image/jpg");
echo $image;