@Adi try it
<?php
include '../session.php';
require_once 'config.php';
if (isset($_GET['id'])) {
$query = "SELECT `id`, `image_name`, `$updated_photo` FROM `crew_info` WHERE `id` = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, 's', $_GET['id']);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $id, $image_name, $updated_photo);
while (mysqli_stmt_fetch($stmt)) {
sprintf("%s", $updated_photo);
}
header("content-type: image/jpeg");
sprintf("%s", $updated_photo);