php blob字段没显示,显示数据库中blob类型的图片,小弟我图片显示不出来

显示数据库中blob类型的图片,我图片显示不出来

showimage.php<?php

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/utilityfunction/SqlHelp.class.php';

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/Comm.class.php';

$SqlHelper = new SqlHelp ( 'read', 'qztoa' );

$sql = "select * from qzt_image";

$query = $SqlHelper->query($sql );

$query_num = $SqlHelper->num_rows ($query );

$rows = array ();

$retarr = array ();

$query =$SqlHelper->query ( $sql );

if($query)

{

$arr_teainfo2 = array ();

while ( $arr_teainfo = $SqlHelper->fetch_assoc($query) ) {

$arr_teainfo2 [] = $arr_teainfo;

$Id=$arr_teainfo["Id"];

echo $arr_teainfo["Id"];

echo "";

}

}

?>

Second.php3

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/utilityfunction/SqlHelp.class.php';

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/Comm.class.php';

$SqlHelper = new SqlHelp ( 'read', 'qztoa' );

$sql = "select * from qzt_image where Id=10";

$query = $SqlHelper->query($sql );

$query_num = $SqlHelper->num_rows ($query );

$rows = array ();

$retarr = array ();

$query =$SqlHelper->query ( $sql );

if($query)

{

$arr_teainfo2 = array ();

while ( $arr_teainfo = $SqlHelper->fetch_assoc($query) ) {

$arr_teainfo2 [] = $arr_teainfo;

$Id=$arr_teainfo["Id"];

$imagetype=$arr_teainfo["imagetype"];

//echo $arr_teainfo["images"];

//Header( "Content-type: $imagetype");

header('Content-type: $imagetype');

echo $arr_teainfo["images"];

}

}

?>

请问我哪里有问题?PHP新人,不知道哪里错了

PHP

分享到:

------解决方案--------------------

引用:Quote: 引用:图片显示不出来,是程序报错?还是路径不对。

先打印下,看有数据没,如果有,再看下,显示的路径是否正确。

先运行php3把image打印出来了,正常的,没有报错

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/utilityfunction/SqlHelp.class.php';

include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/Comm.class.php';

$SqlHelper = new SqlHelp ( 'read', 'qztoa' );

$sql = "select * from qzt_image where Id=10";

$query = $SqlHelper->query($sql );

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值