2013-10-09 45 views
0

這是我對這段腳本的迴應的代碼,我在內容存儲在數據庫的頁面上獲得了內容,但是請讓我知道以圖像形式檢索該內容的方式?如何檢索存儲在數據庫中的圖像?

$query='SELECT * FROM upload_file'; 

$result=mysqli_query($con,$query); 

while($row = mysqli_fetch_array($result)) 
{ 
    echo "<img src=".$row['plaint']." width='100' height='100'></img><br>"; 

} 

回答

0

試試這樣說:

echo '<img src="data:image/jpeg;base64,' . base64_encode($row['plaint']) . '" />'; 

這將數據轉換爲實際的圖像。

相關問題