查詢和HTML表格正在打印出$row["title"]
,日期和row["text1"]
太棒了。但是,$row["file_data"]
存在一個問題,該問題應該是存儲在MySQL數據庫中的映像。它是從英語以外的語言中打印出來的大量字符。即BMö26(šÀ2ÿÿÿÿÿÿÿÿ
等幾十行。來自MySQL數據庫的圖像未打印
如何讓圖像顯示?
由於提前,
約翰
$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 "<table class=\"samplesrec\">";
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 '<tr class="class3a">';
echo '<td class="sitename1"><a href="http://www...com/blog">'.$row["title"].'</a></td>';
echo '</tr>';
echo '<tr class="class3b">';
echo '<td class="sitename2name">'.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</td>';
echo '</tr>';
echo '<tr class="class3c">';
echo '<td class="sitename2">'.$row["text1"].'</td>';
echo '</tr>';
echo '</tr>';
echo '<tr class="class3c">';
echo '<td class="sitename2">'.$row["file_data"].'</td>';
echo '</tr>';
}
echo "</table>";