aecio
Junior Member
 
Brazil
120 Posts |
Posted - 07 December 2001 : 06:43:33
|
I can give you the ASP code to do this:
Just put the following code where you want to show the (5) topics which received the latest posts:
ConnectionString = "DSN=yourDSN;UID=yourUserID;PWD=yourPWD" Set objDB = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") objDB.ConnectionTimeout = 360 objDB.CommandTimeout = 360 objDB.Open ConnectionString
strSQL = "SELECT TOP 5 TOPIC_ID, T_SUBJECT FROM FORUM_TOPICS ORDER BY T_LAST_POST DESC" objRS.Open strSQL,objDB,3, 1, &H0001 If Not objRS.EOF Then Response.Write "<table border=0 width=""100%"" class=""txtpeq"">" For x = 1 to objRS.RecordCount Response.Write "<td align=left class=txtpeq><a href=""forum/topic.asp?TOPIC_ID=" & objRS("TOPIC_ID") & """ class=""txtpeq"">" & objRS("T_SUBJECT") & "</a></td></tr>" objRS.MoveNext Next Response.Write "</table>" End If objRS.Close objDB.Close Set objRS = Nothing Set objDB = Nothing
to show the 5 topics last added, modify the sql line to this:
strSQL = "SELECT TOP 5 TOPIC_ID, T_SUBJECT FROM FORUM_TOPICS ORDER BY T_DATE DESC"
Cheers!  |
 |
|