我需要得到最後5個結果,這就是爲什麼我通過Date DESC命令他們,但我需要顯示從較舊到較新的結果。我怎樣才能做到這一點?MySQL顯示顛倒順序的結果?
$data = mysql_query("SELECT * FROM Badges WHERE UID = '$user' ORDER by Date DESC LIMIT 5");
while($row = mysql_fetch_array($data))
{
print "<img class='badge' title='" . $row['Site'] . "' src='http://getfavicon.appspot.com/http://" . $row['Site'] . "?defaulticon=1pxgif' />";
}
[Limit results to last 10]可能重複(http://stackoverflow.com/questions/7306843/limit-results-to-last-10) –