图像不会显示在MySQL数据库中

时间:2014-01-01 16:26:04

标签: php mysql

我正在尝试根据从mySQL检索的路径显示图像。文件路径正确但不显示。

我的代码是

echo '<td><img src="' .$img_path .$row['image'].'" width="150" height="25" alt="'.$row['date_added'].'" /></td>';

然后输出。

<img width="150" height="25" alt="2014-01-01 15:52:20" src="localhost/website/content/images/profile/test.png"></img>

它还会输出</img>而不是/>我错过了一些明显的东西吗?

1 个答案:

答案 0 :(得分:1)

http://添加到图片路径,如下所示:

echo '<td><img src="http://' .$img_path .$row['image'].'" width="150" height="25" alt="'.$row['date_added'].'" /></td>';
相关问题