Hello everyone,
I want to download an image which was uploaded from the database
Here is my HTML codes for the download link
<a href='download.php?id=<?php echo $data["LRCard"]; ?>'>Download</a>
and here is my download.php code
<?php
include 'Connect.php';
mysql_select_db("student");
$id = $_GET['id'];
$student_id = htmlentities($_REQUEST['id'], ENT_QUOTES);
$result = mysql_query("SELECT LRCard FROM student_information where student_id='$_GET[id]'");
if(mysql_num_rows($result) == 1) {
$fileType = @mysql_result($result, 0, "LRCard");
$fileContent = @mysql_result($result, 0, "LRCard");
header("Content-type: $fileType");
echo $fileContent;
}else{
echo "Record doesn't exist.";
}
?>
IN this code the browser displays "Record doesn't exist."
What does it mean? Please edit my codes.