|
復(fù)制代碼 代碼如下:
<?php
$conn=@mysql_connect("localhost","root","123") or die("服務(wù)器連接錯誤!"); //鏈接數(shù)據(jù)庫
@mysql_select_db("upload",$conn) or die("未發(fā)現(xiàn)數(shù)據(jù)庫!");
$query="select * from upfile where ftag=$fn";
$result=mysql_query($query);
if(!$result) die("error: mysql query");
$num=mysql_num_rows($result);
if($num<1) die("error: no this recorder");
$data = mysql_result($result,0,"picture");
header("Content-type: image/JPEG",true);
echo $data;
?>
上面是圖片提取
前臺顯示文件
復(fù)制代碼 代碼如下:
<img src="image.php?fn=<?php echo $fn;?>">
php技術(shù):php 從數(shù)據(jù)庫提取二進制圖片的處理代碼,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。