主题:请教:::PHP+HEADER函数问题!
IIS+MYSQL+PHP4环境下,我将图片以二进制格式存入数据库,但是读取的时候我查资料需要用以下代码:
<?
$connid=mysql_connect("localhost","root","admin");
mysql_select_db("castct",$connid);
$result=mysql_query("SELECT * FROM news WHERE id=3")
or die("Can't perform Query"); $row=mysql_fetch_object($result);
Header("Content-type: image/jpg"); echo $row->image;
?>
但是预览的时候却要报错,错误信息如下:
Warning: Cannot modify header information - headers already sent by (output started at D:\MyJob\MySite\test3.php:5) in D:\MyJob\MySite\test3.php on line 10
不知道什么问题,请知道的指点下,谢谢先!
<?
$connid=mysql_connect("localhost","root","admin");
mysql_select_db("castct",$connid);
$result=mysql_query("SELECT * FROM news WHERE id=3")
or die("Can't perform Query"); $row=mysql_fetch_object($result);
Header("Content-type: image/jpg"); echo $row->image;
?>
但是预览的时候却要报错,错误信息如下:
Warning: Cannot modify header information - headers already sent by (output started at D:\MyJob\MySite\test3.php:5) in D:\MyJob\MySite\test3.php on line 10
不知道什么问题,请知道的指点下,谢谢先!