图片为何显示出是乱码?
我建了一个数据库my,表格也叫my,里面有字段pic用来存储图片,但现在显示的是乱码,我已经确认图片存到数据库里了,因为刚才显示出来了,但我不知道改动了什么,现在显示了很多的乱码,下面是我的代码,不知道问题出在那了?而且我想显示两张图片,分别为id=1和id=2的图片,为什么只显示id=1的图片呢?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<?php
$handler=mysql_connect("localhost","root",'')or die("数据库连接失败");
echo"数据库连接成功<br>";
mysql_select_db("my",$handler);
$query='select pic from my where id=1';
$result=mysql_db_query('my',$query);
$pic1=mysql_result($result,0,'pic');
echo $pic1;
echo'<br>';
$query='select pic from my where id=2';
$result=mysql_db_query('my',$query);
$pic2=mysql_result($result,0,'pic');
echo $pic2;
?>
</body>
</html>