I use this following code to display the image from database this code fetch the image in the unreadable format, in database i create the image type in "blob" please help me to display image dynamically when user enter name of the image it should display that image only
my db table table name store
id | name |image
---------------
1 | xxxx| (image)
<?php
mysql_connect("localhost","root","")or die(mysql_error());
mysql_select_db("databaseimage") or die(mysql_error());
$query = "SELECT * FROM store where fname = 'ss' ";
$info = mysql_query($query) or die(mysql_error());
$num = mysql_num_rows($info);
$sql ="select image from store where fname = 'ss' ";
$result = mysql_query($sql) or die(mysql_error());
if($result){
echo'
<table align="center" cellspacing="0" cellpadding="5" bgcolor="#ffffff" border=1 bordercolor="#2696b8">
<tr>
</tr>';
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo'<tr>
<td align="center" width="150" height="200"><img src="datadesign.php' . $row['image'] . '">
</tr>';
}
echo'</table>';
}
else{
echo'<h1> System Error </h1> table ';
exit();
}
mysql_close();
?>