【发布时间】:2015-02-23 21:33:56
【问题描述】:
当我尝试使用 url 来图像时遇到了一些问题。
<div class="col-lg-12">
<h1 class="page-header">Anime!</h1>
</div>
<?php
include "config/database.php";
$sql = "SELECT * FROM anime WHERE status = 'On Going' ORDER BY id";
$query = mysql_query($sql);
if ($query > 0){
?>
<div class="container">
<div class="description-plate">
<?php
while
($row = mysql_fetch_array($query)){
$id = $row['id'];
$image = $row['image'];
$title = $row['title'];
$genre = $row['genre'];
$start = $row['start'];
$schedule = $row['schedule'];
$description = $row['description'];
?>
<!--div class="caption-btm">
<p style="margin-left:6px; margin-top:175px;">Start Airing From:</p>
<h5 style="margin-left:10px;"><?php echo $start; ?></h5>
<p style="margin-left:6px;">Airing Schedule:</p>
<h5 style="margin-left:10px;"><?php echo $schedule; ?></h5>
</div-->
<div class="thumbnail-fluid">
<a href="<?php echo $row['image']; ?>">
<div id="og-plate">
<div><img src="admin/<?php echo $row['image']; ?>"></div>
<?php } ?>
</div>
</a>
</div>
</div>
<?php } ?>
</div>
所以当我尝试使用 php 调用图像时,标签只出现在最后一张图像上。我想要做的是在每张图片上都有标签。非常感谢任何帮助,谢谢:)
【问题讨论】:
-
看起来你在图像 div 之后有额外的
<?php } ?>。 -
@dfsq 这就是我发现的
-
糟糕,请再次检查脚本。忘了粘贴完整的脚本,我的错 :)
-
嗯,你在
<a></a>标记的中间有那个右括号,即使现在你需要有 2 个是有道理的,但这仍然没有意义。 -
谢谢艾琳!希望我能为您的回复赢得声誉,但似乎有人因为这个愚蠢的问题而减少了我的代表。 :)