我有一個PHP while循環加載用戶評論 - 我需要排除數據庫中最近的行。PHP while循環 - 排除最近的行?
$sql = "SELECT c.trackid, c.comment, c.time, c.userid, u.id, u.username FROM
comments c
LEFT JOIN users u
ON u.id = c.userid
WHERE trackid='$trackid'
ORDER BY c.time DESC";
$i=1;
while ($row = mysql_fetch_assoc($result)) {
echo "<div class=\"commentDivs\">" . $row['time'] ."<br><br> " . $row['username'] . "<div class=\"userPostedComments\">" . $row['comment'] . "</div></div>";
}
如何從循環中排除最近的行?
什麼是你的SQL查詢? –
...你的問題是什麼? – evilone