我試圖從MySQL數據庫中檢索圖像。我得到這個錯誤:從數據庫中獲取圖像
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\empinfo.php:13) in C:\xampp\htdocs\empinfo.php on line 39
<?php
header("content_type:" . $row["image_type"]);
?>
<?php echo $info['image']; ?></td>
</tr>
</table>
<?php } ?>
請問*爲什麼*您爲什麼*將實際圖像存儲在數據庫中,而不是路徑?您的代碼無法正常工作,因爲您將內容類型設置爲圖像,然後使用HTML – andy
實際上:您的錯誤與您在輸出內容之後使用'header' *的事實有關:https:// stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php但即使修復它也不會工作 – andy