我正在尝试显示图像,然后在图像下显示描述。我得到了图像显示,但我对描述感到困惑。我无法让它发挥作用。
在我的代码下面显示图像和描述
// Get images from the database
$query = $db->query("SELECT * FROM images ORDER BY uploaded_on DESC");
$description = $db->query("SELECT * FROM description ORDER BY uploaded_on DESC");
if($query->num_rows > 0){
while($row = $query->fetch_assoc()){
$imageURL = 'upload/'.$row["file_name"];
?>
<center><img src="<?php echo $imageURL; ?>" alt="" /><br><p><?php echo $description; ?></p></center>
<?php }
}else{ ?>
<p>No image(s) found...</p>
<?php } ?>
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)