I have a Products_Images table which stores the images in BLOB format. I want to show all the images and product details in 'View All Products' page. To accomplish this task I have created the following program, but its not giving me the desired output. Kindly check it.
Thanks.
<?php
include 'connect.php';
$query= "select distinct product_id, image from product_images";
$query_run= mysql_query($query);
while ($query_fetch= mysql_fetch_assoc($query_run))
{
echo '</br>';
echo $query_fetch['image'];
}
header("Content-type: image/jpeg");
?>
Displaying The Image
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<br />
<img src="all_images.php" alt="Image" width="50" height="50" />
<body>
</body>
</html>