这是我的源代码。我无法显示图片
<?php
include "koneksi.php";
$datatamu= mysql_query("select judul_gambar,nama_file from gambar order by judul_gambar asc");
echo "
<table>
<tr>
<th>judul_gambar</th>
<th>gambar</th>
</tr>";
while($rec=mysql_fetch_object($datatamu)){
echo "<tr>";
echo "<td>".$rec->judul_gambar."</td>";
echo "<td";
echo "<img src='.$rec->nama_file.' alt='.$rec->judul_gambar' title='.$rec->judul_gambar' width='100'>";
echo "</td>";
echo "</tr>";
}"
</table>";
mysql_close();
?>
我创建与源代码相同的目录下的一个文件夹。图片。 这里是数据库
id_gambar:INT [5]
judul_gambar:VARCHAR [25]
nama_file:VARCHAR [25]
对不起,如果我的英语不好。 :)
究竟是什么问题? –
我无法显示图片:) – jarenjarfa
SQL位有问题吗?可能。这可能是因为你没有首先获得URL。做一个var_dump(object)并查看它是否打印URL。 –