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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…