我需要得到最后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) –