I have a plugin that queries the 7 most replied-to threads in the last 24 hours and displays it in a separate section of my forum. The query shown below works exactly as I want it to, grabbing all the threads in the last 24 hours, ordering them by replycount and grabbing the top 7.
PHP Code:
$twentyfourago= time() - (3600 * 24);
$popularquery="SELECT * FROM `thread` where `dateline` >= $twentyfourago ORDER BY `replycount` DESC LIMIT 7";
$merge=mysql_query($popularquery);
echo mysql_error();
while($popularrow=mysql_fetch_array($merge)){
$populardisplay .= "<b><a href='showthread.php?t=$popularrow[threadid]'>$popularrow[title]</a></b> <br />
<span class='smallfont'> by
<a href='http://www.nwfans.com/member.php?u=$popularrow[postuserid]'>$popularrow[postusername] </a></span><br/>";
}
The threads are displayed with the most replied-to threads at the top and the 7th most replied-to at the bottom. What I'm wondering is how I can rearrange this so that it displays the threads by dateline with the oldest threads on top and the newest threads on the bottom. I would need to rearrange my query results after the query runs but before I display the results on the page.