Author |
Topic |
|
Reichert
Starting Member
11 Posts |
Posted - 04 May 2001 : 13:41:18
|
I am pretty new here, so excuse me if this has been done before. I searched the board but could not find a fix, so I tackled it myself. In the latest version of recent.asp I could find, I fixed it to work with mySQL as so:
In active.asp:
line 101:
quote:
strSql = "SELECT top " & MostRecent & " " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, "
strSql = "SELECT " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, "
line 116
quote:
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC;"
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC LIMIT " & MostRecent & ";"
Basically you are replacing the "TOP" predicate with "LIMIT" at the end of the SQL statement. I am sure this same procedure could be used for a lot of code that uses "TOP". Anyhow, hope it helps someone else here.
Stephen Palmer -=- Reichert root@ Gearbox Software Micah 6:8 "He has showed you, oh man, what is good ... "
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 May 2001 : 14:12:00
|
simply replacing the lines as you have will not work with other db's, a better solution would be to check the dbtype and then use the correct line accordingly
|
|
|
Reichert
Starting Member
11 Posts |
Posted - 04 May 2001 : 14:50:52
|
quote:
simply replacing the lines as you have will not work with other db's, a better solution would be to check the dbtype and then use the correct line accordingly
Excuse me, you are correct, I will fix the original post.
Stephen Palmer -=- Reichert root@ Gearbox Software Micah 6:8 "He has showed you, oh man, what is good ... "
|
|
|
Reichert
Starting Member
11 Posts |
Posted - 04 May 2001 : 15:02:45
|
quote:
Excuse me, you are correct, I will fix the original post.
Well, nevermind, I can't edit my posts, so here is a link to the fixed code, with proper check for DBtype.
http://www.gearboxsoftware.com/recent.txt
Stephen Palmer -=- Reichert root@ Gearbox Software Micah 6:8 "He has showed you, oh man, what is good ... "
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 May 2001 : 15:54:01
|
Thanks for posting the code.
|
|
|
|
Topic |
|
|
|