mysql数据库打印_来自MySQL数据库的图像不打印

查询和HTML表格打印出$row["title"],日期和row["text1"]非常棒。但是,$row["file_data"]存在问题,应该是存储在MySQL数据库中的图像。它是用英语以外的语言打印出的大量字符,i。即几十行BMö26(šÀ2ÿÿÿÿÿÿÿÿ等。

如何显示图像?

提前致谢,

约翰

$sqlStr = "SELECT s.title, s.datesubmitted, s.text1, s.text2, s.text3, s.cleanurl1, s.cleanurl2, s.cleanurl3, s.submissionid, i.image_id, i.filename, i.mime_type, i.file_size, i.file_data, i.photonumber

FROM submission s

JOIN images2 i on s.submissionid = i.submissionid

GROUP BY s.submissionid

ORDER BY s.datesubmitted DESC

LIMIT $offset, $rowsperpage";

$tzFrom = new DateTimeZone('America/New_York');

$tzTo = new DateTimeZone('America/Phoenix');

// echo $dt->format(DATE_RFC822);

$result = mysql_query($sqlStr);

//header('Content-type: image/bmp');

$arr = array();

echo "

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

//header('Content-type: ' . $row['mime_type']);

//header('Content-length: ' . $row['file_size']);

$dt = new DateTime($row["datesubmitted"], $tzFrom);

$dt->setTimezone($tzTo);

echo '

';

echo '

'.$row["title"].'';

echo '

';

echo '

';

echo '

'.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'';

echo '

';

echo '

';

echo '

'.$row["text1"].'';

echo '

';

echo '';

echo '

';

echo '

'.$row["file_data"].'';

echo '

';

}

echo "

";
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值