<?php
require_once __DIR__ . '/db.php';
if (isset($_GET['image_id'])) {
$sql = "SELECT imageType,imageData FROM tbl_image WHERE imageId=?";
$statement = $conn->prepare($sql);
$statement->bind_param("i", $_GET['image_id']);
$statement->execute() or die("<b>Error:</b> Problem on Retrieving Image BLOB<br/>" . mysqli_connect_error());
$result = $statement->get_result();
$row = $result->fetch_assoc();
header("Content-type: " . $row["imageType"]);
echo $row["imageData"];
}
?>
as such there is no error in code just when i tried to download file there is empty image is coming as output. no data is present in image i want img should get data and give the proper output
also this same code is running in local xampp database. with same database export and import in my local pc