首页  >  文章  >  后端开发  >  显示数据库中blob类型的图片,小弟我图片显示不出来

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

WBOY
WBOY原创
2016-06-13 12:44:002149浏览

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

<?php  <br />
include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/utilityfunction/SqlHelp.class.php';<br />
include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/Comm.class.php';<br />
<br />
$SqlHelper = new SqlHelp ( 'read', 'qztoa' );<br />
$sql = "select * from qzt_image";<br />
$query = $SqlHelper->query($sql );<br />
$query_num = $SqlHelper->num_rows ($query );<br />
<br />
$rows = array ();  <br />
$retarr = array (); <br />
$query =$SqlHelper->query ( $sql );<br />
if($query)<br />
{<br />
$arr_teainfo2 = array ();<br />
while ( $arr_teainfo = $SqlHelper->fetch_assoc($query) ) {<br />
$arr_teainfo2 [] = $arr_teainfo;<br />
$Id=$arr_teainfo["Id"];<br />
echo $arr_teainfo["Id"];<br />
echo "<IMG SRC=\"Second.php3?Id=$Id\">"; <br />
<br />
}<br />
}<br />
<br />
<br />
<br />
?>  <br />


Second.php3
<?php  <br />
include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/utilityfunction/SqlHelp.class.php';<br />
include_once dirname(dirname (dirname ( __FILE__ ))). '/yeqztsys1.0/Comm.class.php';<br />
<br />
$SqlHelper = new SqlHelp ( 'read', 'qztoa' );<br />
$sql = "select * from qzt_image where Id=10";<br />
$query = $SqlHelper->query($sql );<br />
$query_num = $SqlHelper->num_rows ($query );<br />
<br />
$rows = array ();  <br />
$retarr = array (); <br />
$query =$SqlHelper->query ( $sql );<br />
if($query)<br />
{<br />
$arr_teainfo2 = array ();<br />
while ( $arr_teainfo = $SqlHelper->fetch_assoc($query) ) {<br />
$arr_teainfo2 [] = $arr_teainfo;<br />
$Id=$arr_teainfo["Id"];<br />
$imagetype=$arr_teainfo["imagetype"];<br />
//echo $arr_teainfo["images"];<br />
//Header( "Content-type: $imagetype"); <br />
header('Content-type: $imagetype');<br />
echo $arr_teainfo["images"];<br />
<br />
}<br />
}<br />
<br />
?>   <br />


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

PHP
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn