How to display images stored in mysql database onto php page?

Emperor

New member
Hello,
I have been working upon the same, trying to display the stored images, I stored the images in tinyblob format in mysql database, and everytime i display the results i get a weird set of alphanumberic characters, heres the reference page:
faculty.poly.edu/~yjeanpie/search.html
type in f, in the search box and u will see the results ,,images dont display at all after i used this code :
<form enctype="multipart/form-data" action="allproducts.php" method="POST">

<table border = 2 cellspacing="0" cellpadding="0" align="right" valign="top">
<tr><th>Image</th><th>Category</th><th>Sub-Category</th><th>Product Name</th><th>Version</th></tr>
<?php
while($mem=mysql_fetch_array($result))
{
$number1=$mem['category'];
$number=$mem['prod_name'];
$number3=$mem['sub_category_name'];
$number5=$mem['prod_model_version'];
$number2=$mem['img'];

?>
<tr>
<td><?php
$sql3="select img from PRODUCTS where img='$number2'";

$result3=mysql_query($sql3);
$rowcount3=mysql_num_rows($result3);
if($rowcount3<1)
{
$rate='nothing here';
}
else
{
while($row3=mysql_fetch_array($result3))
{
$rate=$row3[0];
}
}
?>
<?php
if($rate!=null)
//header("Content-type: image/jpeg");
echo '<img src="'.$rate.'">';
else
echo "*";
?>
</td><td>

any help with the same will be appreciated a lot !
 
Back
Top