i write bellow code to display images from database
<?php
mysql_connect("localhost","root","");
mysql_select_db("test");
$qry = "select id from image";
$res = mysql_query($qry) or die(mysql_error());
while($row = mysql_fetch_array($res))
{
echo "<img src=image.php?id='$row[0]'>";
}
?>
Image.php
<?php
$query = mysql_query("SELECT img FROM images WHERE id = ".$_GET['id']);
$row = mysql_fetch_array($query);
if($type=="pjpeg")
$type="jpeg";
header("Content-type:$type");
echo $row['img'];
?>
but this will not work. it display blank image icon.
You also might use base64 encoding to build in the image. Like
UPDATE, base64 encoding example
You can do that easily: