Am trying to display some php fields in a html table....
all ok except the blob file 'person_photo' which displays as a broken image ?
with the following as the img source :
http://localhost/xampp/mydb/image_test.php?id=10
where record 10 'person_photo" has a valid photo ???
is it syntax or me ??
My display page :
Print"<table width='100%' height='1000' border cellpadding=1>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<td height='59'> </td>";
Print "<td >Lastname : " .$info['person_lastname'] . "</td>";
Print "<td width='20%> </td>";
Print "<td width='18%'>Firstname : ".$info['person_firstname'] . "</td>";
Print "<td width='18%'> </td>";
Print "<td width='22%' rowspan='5'>Photo: <img src='display_image.php?id=" . $info['person_id'] . "' alt='Picture here' /></td>";
Print "<td width='5% rowspan='7'> </td>";
Print "</tr>";
Print "</table>";
}
?>
display_image.php
<?php
// primary key
$id = (int)$_GET['id'];
$query = "SELECT * FROM people WHERE id = $id";
$data = mysql_query($query);
$info = mysql_fetch_array($data);
header('Content-type: image/jpeg');
echo $info['person_photo'];
?>