查询和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 "
";