来自数据库的图像未显示. [英] Image from database is not getting displayed.
本文介绍了来自数据库的图像未显示.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将图像以及宽度和高度另存为斑点.我有图像ID,但是当我从mysql检索图像时,图像未显示在我的PHP页面上.
我通过传递图像ID从一个页面保存图像并在另一页面中检索.
我正在将此代码用于src
I saved image as blob along with width and height. I have image id, but when I retrieve the image from mysql, image is not getting displayed on my PHP page.
I am saving the image from one page and retriving in another page by passing image id.
I am using this code for src
echo "\n<IMG SRC=\"image.php?image_id=$image_id\" />";
并且在image.php中,我具有用于检索值的代码.
and in image.php I have the code to retrive the values.
推荐答案
image_id \"/>" ;
image_id\" />";
并且在image.php中,我具有用于检索值的代码.
and in image.php I have the code to retrive the values.
不要使用img src显示从mysql检索的图像
标头(内容类型:图片/jpeg")
打印
Don''t use the img src for display the retrive image from mysql
header("Content-type:image/jpeg")
图片
image
这篇关于来自数据库的图像未显示.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文