PHP 如何让其降序显示 我的代码如下 急求

来源:百度知道 编辑:UC知道 时间:2024/06/25 02:31:36
php文件:$fadtxtlist1 = array();
$query = $db->query("SELECT t.subject,t.tid ,t.fid ,f.name ,f.fid FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid in (2,3,4) ORDER By t.dateline LIMIT 0,3");
while ($thread = $db->fetch_array($query)) {
$thread['subject'] = homestr(hb169net_ubb($thread['subject']),32);
$thread['date'] = gmdate("n.j",$thread[dateline]+($timeoffset * 3600));
$fadtxtlist1[] = $thread;
}
$fadtxtlist2 = array();
$query = $db->query("SELECT t.subject,t.tid ,t.fid ,f.name ,f.fid FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid in (11,12,13) ORDER By t.dateline LIMIT 0,3");
while ($thread = $db->fetch_array($query)) {
$thread['subject'] = homestr(hb169net_ubb($thread['subject']),32);
$thread['date'] = gmdate("n.j",$thread[dateline]+($timeoffset

你写phpcms的?

你是想通过时间降顺还是通过id降序,我看没实现,因为你mysql语句中没有DESC

如果你想通过时间降序的话就得在order by 时间 desc

如果想通过id降序的话就就得在 order by id desc