The code im using to do that i cant really share because its not even actually ASP, Its wscript code being run as a schedulded task that recreates the top 10 posts etc every 30 mins, i figured that was more efficient because its being used on my sites homepage.
But heres how i did it. Im very new to PHP and MySQL, so it cant be that hard.
Goto PHP.net and install the ADO thingymebob.
Set up an ADO connection on your server to the MySQL database.
Use PHP my Admin or look in createtables.php to find the field names.
The perform an SQL query as you normally would but connecting to the MySQL forum ADO connection.
Volla!
Heres my SQL query for the top threads, ive hard coded a few bits like the board
SELECT B_Number, B_Subject, B_Board FROM w3t_Posts WHERE B_Number = B_Main AND B_Last_Post > " & DATEDIFF("s", "01/01/1970", DATEADD("s", -(7*86400), NOW())) & " AND B_Board='UBB2' ORDER BY B_Replies DESC LIMIT 10
This pulls the top 10 posts from board UBB2 that are more recent than a week sorted by replies descending
Kristian