下面的代码是我的PHP脚本的一部分,它应该在产品信息前显示产品图像。使用PHP插入图像
每个图像均标记为product_id
。那些自动增加并从MySQL数据库接收的ID。
PHP代码:
while($row=mysql_fetch_array($result)){
$ProductName = $row['product_name'];
$ProductCat = $row['product_cat'];
$Email = $row['email'];
$ID = $row['product_id'];
//-display the result of the array
echo '<div ><img align="right" src="/project_images/$ID.JPG" width="280" height="125" /></div>';
的图像显示为已损坏的浏览器。
是因为图像大小错误(可能太大)或代码错误?
当您直接从地址栏打开图像的URL会发生什么? –
你可以检查元素(布朗)和写结果? – Anri
是的,只是图像损坏 –