// retrieve blob content from database $sql = "SELECT * FROM TravelImage WHERE ImageID=:id"; $statement = $pdo->prepare($sql); $statement->bindParam(':id', $_GET['id']); $statement->execute(); $result = $statement->fetch(PDO::FETCH_ASSOC); if ($result) { // Output the MIME header header("Content-type: image/jpeg"); // Output the image echo ($result["ImageContent"]); }