Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD FIX: active.asp using mySQL
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Reichert
Starting Member

11 Posts

Posted - 04 May 2001 :  13:41:18  Show Profile
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  Show Profile  Visit HuwR's Homepage
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

Go to Top of Page

Reichert
Starting Member

11 Posts

Posted - 04 May 2001 :  14:50:52  Show Profile
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 ... "
Go to Top of Page

Reichert
Starting Member

11 Posts

Posted - 04 May 2001 :  15:02:45  Show Profile
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 ... "
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 May 2001 :  15:54:01  Show Profile  Visit HuwR's Homepage
Thanks for posting the code.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07