日期:2014-05-18  浏览次数:20528 次

如何按照降序排序时间
以下代码怎么才能改成以time为降序来排序时间
PHP code

$sql = "SELECT k.id, k.uid AS likeuid,k.time as ktime, b . * , m.username, m.domain
                FROM `".DBPRE."likes` AS k
                LEFT JOIN `".DBPRE."blog` AS b ON k.bid = b.bid
                LEFT JOIN `".DBPRE."member` AS m ON b.uid = m.uid WHERE k.uid = '{$_SESSION['uid']}'";



------解决方案--------------------
ORDER BY [TIME] DESC
------解决方案--------------------
order time desc
------解决方案--------------------
order by k.time desc
?
------解决方案--------------------
order by ktime desc
------解决方案--------------------
$sql = "SELECT k.id, k.uid AS likeuid,k.time as ktime, b . * , m.username, m.domain
FROM `".DBPRE."likes` AS k
LEFT JOIN `".DBPRE."blog` AS b ON k.bid = b.bid
LEFT JOIN `".DBPRE."member` AS m ON b.uid = m.uid WHERE k.uid = '{$_SESSION['uid']}' order by ktime desc";
------解决方案--------------------
探讨
我就是想问 order by k.time desc放到哪个位置啊?