使用BLOB处理保存在MySQL DB上的图片 [英] Handling pictures saved at MySQL DB using BLOB

查看:257
本文介绍了使用BLOB处理保存在MySQL DB上的图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在BLOB字段中保存了一张图片.

我想用PHP展示它,但是我得到的似乎是ASCII码.

I have a picture saved at a BLOB field.

I want to show it with PHP, but I''m getting what appears to be the ASCII code.

$resultado11 = mysql_query("SELECT * FROM Images") or die ("problema-- ".mysql_error());
    $row=mysql_fetch_object($resultado11);
    //Header( "Content-type: image/gif");
    echo $row->Image;



也许问题出在我未读过的地方而不使用标题.问题是,如果取消注释该行我有一个错误(我得到一个空白页).我也不知道如何处理该标头,因为图片可能是.jpg或.png ...(或没有区别)?



Maybe the problem is not using the header as I have read somewhere. The problem is if uncomment that line I have an error (I get a blank page). Also I dont know how to handle that header, because picture could .jpg or .png... (or does not make a difference) ?

推荐答案

resultado11 = mysql_query(" )死(" .mysql_error());
resultado11 = mysql_query("SELECT * FROM Images") or die ("problema-- ".mysql_error());


row = mysql_fetch_object(
row=mysql_fetch_object(


resultado11); // Header("Content-type:image/gif"); echo
resultado11); //Header( "Content-type: image/gif"); echo


这篇关于使用BLOB处理保存在MySQL DB上的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆