求助图片显示问题

求助图片显示问题

我想调用数据库中的图片,可是总无法显示,代码如下,望高手指点!
<?php
include("conn/conn.php");

$result=mysql_query("select * from tb_tpsc");
header("Content-type:   image/jpeg");   

while($info=mysql_fetch_array($result))
{

?>
<table width="600" align="center">
<tr>
<td><img src="image1.php?id=<?php echo $info[id];?>"></td>

</tr>
<tr>
<td><?php echo $info[tpmc];?> <?php echo $info[scsj];?></td>
</tr>
</table>
<?php

}

?>

下面是imge1.php
<?php
include "conn/conn.php";
if($id){
header("Content-type:   image/jpeg");   
$result=mysql_query("select * from tb_tpsc where id='$id'");
$data = MYSQL_RESULT($result,0, "file");
echo $data;
}
?>

imge1.php可以显示?
如履薄冰

当在imge1.php中为$id赋值时可以显示图片

image1.php?id=<?php echo $info[id];?>
这个id是url参数,在image1.php页面
要用 $_GET['id'] 而不是直接用 $id
如履薄冰

果然如此!
谢谢啦!