我正在尝试从数据库中检索五个图像并以单行显示这些图像。我的代码正在检索所有图像'数据但不是图像本身。我做错了什么?
这是我的代码:
<?php
include "config.php";
$q = mysql_query("SELECT * FROM register r
JOIN videos v ON r.id = v.video_id
ORDER BY r.id desc LIMIT 5") or die (mysql_error());
$headers = $col = "";
$row=mysql_num_rows($q);
$s=null;
while ($row = mysql_fetch_array($q))
{
if($row['id']!=$s)
{
$s = $row['id'];
echo "<div class='property'>";
echo "<div class='property1' >";
echo "<a href='#'><img src='".$row['path']."' height='100' width='170' style= margin:5px;></a>";
echo "</div>";
echo "<div class='property2'>";
echo $row['videoname'];
echo "</div>";
echo "<div class='property3'>";
echo "<br/>";
echo "by:";
echo $row['name'];
echo "<br/>";
echo "</div>";
echo "<div class='property4'>";
echo $row['views'].' views ';
echo $row['time'].' year ago';
echo "</div>";
echo "</div>";
}
}
?>