
php读取mysql中的二进制图片不显示
image.php中的代码<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.o...
image.php 中的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<img src="img_look.php"/>
</body>
</html>
img_look.php中的代码
<?php
include_once'./include/config_mysql.php';
$db = new ConnectionMySQL();
$result=mysql_query("select * from teacher ") or die("Can't perform Query");
$row=mysql_fetch_object($result);
// header( "Content-type: image/png ");
echo $row->image;
?>
显示的结果: 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<img src="img_look.php"/>
</body>
</html>
img_look.php中的代码
<?php
include_once'./include/config_mysql.php';
$db = new ConnectionMySQL();
$result=mysql_query("select * from teacher ") or die("Can't perform Query");
$row=mysql_fetch_object($result);
// header( "Content-type: image/png ");
echo $row->image;
?>
显示的结果: 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询