ESH/get_document.php
2024-10-23 18:28:06 +05:30

23 lines
619 B
PHP

<?php
include('includes/config/config.php');
$doc_id =$_REQUEST['doc_id'];
$query = "select * from medical_document where id = '".$doc_id."'";
if (!$result = @mysqli_query($conn,$query)) {
error_log ( "Failed to retrieve Document Exception:" . mysqli_error($conn) . " Query::: " . $query );
exit(mysqli_error($conn));
}
$data = array();
if(mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
header("Content-type: " . $row["medical_doc_type"]);
echo ($row['medical_doc']);
}
}
else
{
echo "Data not found!";
}
?>