【发布时间】:2015-09-08 21:36:32
【问题描述】:
我正在尝试用 MySQL 填充这个网页设计,但我不知道该怎么做,我知道如何通过关联数组来做一个简单的 while loop,但这似乎很混乱。
我的查询字符串:
$recent_query = "SELECT * FROM RES WHERE ListAgentID='2752' ORDER BY ListDate LIMIT 4";
我的 while 循环来获取行
while ($rf = mysqli_fetch_assoc($recent_result)) {
echo <<<RECENT
<div class="property-row">
<article class="hentry has-featured">
<div class="property-featured">
ROW 1
</div>
</article>
<article class="hentry has-featured">
<div class="property-featured">
ROW 2
</div>
</article>
</div>
<div class="property-row">
<article class="hentry has-featured">
<div class="property-featured">
ROW 3
</div>
</article>
<article class="hentry has-featured">
<div class="property-featured">
ROW 4
</div>
</article>
</div>
RECENT;
}
我不知道如何将这 4 篇文章填充为单独的 mysql 行。我想查询 4 行并将它们填充到 HTML 中。我只是似乎做不到。请帮忙。谢谢。
这是滑块的实时示例,在最近的属性下:http://html.nootheme.com/citilights/
【问题讨论】:
-
什么意思,4 篇文章?您从查询中获得的每条记录都是一篇文章?
-
滑块有 2 行,每行 2 篇文章,所以 4 篇文章。我只是不知道如何使每篇文章成为单独的 mysql 行。
-
有人可以帮忙吗?