sebbe
02-26-2006, 02:57 PM
Ok I asked on vb.com but no one anwers there so I thought you guys know ho to go about this!? :cool:
____________________
I'm writing a script on a page outside of vb. I want it to print the 20 latest threads from a few specific forums that has got most replies in the last two weeks.
I'm currently in the learning state of MySQL and I think this could be a quite easy query for you pros.
Appreciate any effort to help, here's what I got so far :cool:
$currentudate = date("U");
$twoweeks = $currentudate - '1209600';
$query = "SELECT title, postusername, threadid, postuserid, dateline, from_unixtime(dateline), forumid, replycount, views, from_unixtime(lastpost)
FROM thread
WHERE dateline >= $twoweeks
ORDER BY replycount
DESC LIMIT 20";
I know this print the threads that were created in the last two weeks but as I said above, I want 20 threads which has got the most replies in the last two weeks.
Nvm I SELECT so many columns, I need them for something else.
Thanks!
____________________
I'm writing a script on a page outside of vb. I want it to print the 20 latest threads from a few specific forums that has got most replies in the last two weeks.
I'm currently in the learning state of MySQL and I think this could be a quite easy query for you pros.
Appreciate any effort to help, here's what I got so far :cool:
$currentudate = date("U");
$twoweeks = $currentudate - '1209600';
$query = "SELECT title, postusername, threadid, postuserid, dateline, from_unixtime(dateline), forumid, replycount, views, from_unixtime(lastpost)
FROM thread
WHERE dateline >= $twoweeks
ORDER BY replycount
DESC LIMIT 20";
I know this print the threads that were created in the last two weeks but as I said above, I want 20 threads which has got the most replies in the last two weeks.
Nvm I SELECT so many columns, I need them for something else.
Thanks!