【发布时间】:2014-12-29 02:53:39
【问题描述】:
有人可以建议如何解决这个问题吗?
我想从我的 SHOUTBOX 表中按 id 调用前 50 行,但在 div 中按升序显示它们(最近的行(最新的)在底部)
例如;
最近的一行是 id 200, 我想调用第 150 - 200 行, 将它们显示在 div 中;
150, 151, 152, . . 。ETC . . 200
我的 PHP 代码目前看起来像这样;
$recall=mysql_query("SELECT *, DATE_FORMAT(timepost,'%H:%i:%s') as timepost FROM shoutbox ORDER BY id DESC LIMIT 50");
while($comm=mysql_fetch_object($recall)){
if ($comm->poster == "System"){
print"<font color=#3399FF>$comm->timepost-<strong><a href='profile.php?viewuser=$comm->poster' target='iframecontent'><font color=#3399FF>$comm->poster</font></a></strong>: </font>";
echo replace($comm->post);
echo"<br>";
}
但它会在 div 中返回我的数据;
200, 199, 198, . . 。ETC . . 150
有人可以帮忙吗?
注意:我目前正在处理我的所有页面并将所有 mySQL 查询转换为 PDO
【问题讨论】: