【发布时间】:2012-08-20 22:03:40
【问题描述】:
我正在尝试创建重复的divs,其中每个数据都从 SQL 数据库获得。我有创建divs 并使用正确数据填充正确字段的代码,但我的代码将divs 相互嵌套。
<?php
$query = mysql_query("SELECT id, name, location, amountRequested FROM fundable");
while ($temp = mysql_fetch_array($query)) {
echo "<div class='widgetLoan'>";
echo "<div class='title'><h6>".$temp['name']."</h6><span class='widgetLoanCat'>Category</span>";
echo "<div class='num'><a href='#' class='blueNum'>".$temp['amountRequested']."</a></div>";
echo "</div>";
}
?>
【问题讨论】:
-
你没有关闭“title” div