Author |
Topic |
Lococoin
Starting Member
38 Posts |
Posted - 15 August 2003 : 02:24:59
|
im getting this error where it should show last 25 members seen
ADODB.Recordset.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near '25 member_id, m_name, m_lastheredate FROM FORUM_MEMBERS ORDER BY M_LASTHEREDATE ' at line 1
/forums/member_stats.asp, line 253
any ideas? |
|
|
gelliott
Junior Member
USA
268 Posts |
Posted - 15 August 2003 : 08:09:53
|
check your code in that file around line 253, look for the following lines:function DisplayLastSeen()
dim rs
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT TOP " & intLastSeen & " MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC" Do they match exactly? |
* The optimist says the cup is half full. The pessimist says it's half empty. But the engineer knows the truth - the cup's design is incorrectly sized. |
|
|
Lococoin
Starting Member
38 Posts |
|
gelliott
Junior Member
USA
268 Posts |
Posted - 18 August 2003 : 12:43:12
|
This MOD uses existing tables and fields from the 3.4.03 version of the forum, which is what you appear to have installed - thus, the file should work on the spot the moment it is copied (no changes necessary).
Try using a fresh copy of the member_stats.asp file, and if that doesn't work post a link to a text copy of your member_stats.asp file. |
* The optimist says the cup is half full. The pessimist says it's half empty. But the engineer knows the truth - the cup's design is incorrectly sized. |
|
|
HolyOutlaw
Starting Member
USA
41 Posts |
Posted - 21 August 2003 : 22:56:53
|
I am experiencing the exact same error as Lococoin.. any word on the fix? |
|
|
gelliott
Junior Member
USA
268 Posts |
Posted - 23 August 2003 : 20:26:14
|
The fix is in my above post - if you have a functioning version of Snitz 3.4.03, a fresh download will work. There are no code changes to make, nothing to error out.
Try using a fresh copy of the member_stats.asp file, and if that doesn't work post a link to a text copy of your member_stats.asp file. |
* The optimist says the cup is half full. The pessimist says it's half empty. But the engineer knows the truth - the cup's design is incorrectly sized. |
|
|
HolyOutlaw
Starting Member
USA
41 Posts |
Posted - 23 August 2003 : 21:50:13
|
well, I am using the members_stat.asp file straight from your zip file... so nothing to really post... |
|
|
geminione
Starting Member
39 Posts |
Posted - 25 August 2003 : 00:34:24
|
i've achived the same error... for the "25 members Last Seen" portion
quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '25 member_id, m_name, m_lastheredate FROM FORUM_MEMBERS ORDER B
/member_stats.asp, line 262
|
|
|
wrc1
Starting Member
47 Posts |
Posted - 28 August 2003 : 02:44:39
|
that's my error :
ADODB.Recordset.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near '25 member_id, m_name, m_lastheredate FROM FORUM_MEMBERS ORDER BY M_LASTHEREDATE ' at line 1
/forum/member_stats.asp, line 253
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 28 August 2003 : 03:44:46
|
For those of you using MySQL, the SELECT TOP command doesn't work with MySQL. Only Access or MS SQL databases.
Change this line in your file:strSql = "SELECT TOP " & intLastSeen & " MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC" to this:if strDBType = "mysql" then
strSql = "SELECT MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC LIMIT " & intLastSeen
else
strSql = "SELECT TOP " & intLastSeen & " MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC"
end if The red text is what I have added to the code. This will work for both access databases and mysql databases. |
Support Snitz Forums
|
|
|
wrc1
Starting Member
47 Posts |
Posted - 28 August 2003 : 04:20:51
|
thx.
but i get this error after i changed the code :
top 25 posters :
ADODB.Recordset.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near '25 member_id, m_name, m_posts FROM FORUM_MEMBERS ORDER BY M_posts DESC' at line 1
/forum/member_stats.asp, line 338
|
|
|
wrc1
Starting Member
47 Posts |
Posted - 28 August 2003 : 05:50:53
|
first i get the error for 25 members last seen. I changed my code and there is no problem any more for 25 members last seen. But now there is a problem with Top 25 posters. Could someone help me with the code to change that. I think there will be also a problem with "Top 25 replied to topics" and for "top 25 read topics" If someone could help me ? or if you can post the changed file.
thx |
|
|
ErEf
New Member
Netherlands
74 Posts |
Posted - 28 August 2003 : 06:59:30
|
the site statistics are also showing stats from hidden forums :( |
If you think you can or you think you cannot, you are right. - Henry Ford |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 28 August 2003 : 12:35:08
|
Any SQL code in the file that looks like this:"SELECT TOP " & intLastSeen & " MEMBER_ID ...
You need to remove the TOP " & intLastSeen & " and just have:SELECT MEMBER_ID ...
Then at the end of the SQL query you will put the command LIMIT along with with variable intLastSeen. The variable name might change with each sql query. So your query should look like this:SELECT MEMBER_ID ... ORDER BY M_LASTHEREDATE DESC LIMIT " & intLastSeen
Recap: So you remove the TOP command from the query. Remove the variable that was after the TOP command and move it to the end and put in the LIMIT command, just as I showed you above, as an example.
The errors you are getting is mysql complaining that it doesn't understand the TOP command. |
Support Snitz Forums
|
|
|
wrc1
Starting Member
47 Posts |
Posted - 29 August 2003 : 08:04:03
|
if you have the same problem if i had, here is the solution :
find : strSql = "SELECT TOP " & intLastSeen & " MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC"
replace with : if strDBType = "mysql" then strSql = "SELECT MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC LIMIT " & intLastSeen else strSql = "SELECT TOP " & intLastSeen & " MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC" end if
find : strSql = "SELECT TOP " & intTopPosters & " MEMBER_ID, M_NAME, m_posts FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_posts DESC"
replace with: if strDBType = "mysql" then strSql = "SELECT MEMBER_ID, M_NAME, m_posts FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_posts DESC LIMIT " & intLastSeen else strSql = "SELECT TOP " & intTopPosters & " MEMBER_ID, M_NAME, m_posts FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_posts DESC" end if
find : strSql = "SELECT TOP " & intRepliedTopics & " TOPIC_ID, T_SUBJECT, T_REPLIES,FORUM_ID FROM " & strTablePrefix & "TOPICS ORDER BY T_REPLIES DESC"
replace with : if strDBType = "mysql" then strSql = "SELECT TOPIC_ID, T_SUBJECT, T_REPLIES,FORUM_ID FROM " & strTablePrefix & "TOPICS ORDER BY T_REPLIES DESC LIMIT " & intLastSeen else strSql = "SELECT TOP " & intRepliedTopics & " TOPIC_ID, T_SUBJECT, T_REPLIES,FORUM_ID FROM " & strTablePrefix & "TOPICS ORDER BY T_REPLIES DESC" end if
find : strSql = "SELECT TOP " & intReadTopics & " TOPIC_ID, T_SUBJECT, T_VIEW_COUNT,forum_id FROM " & strTablePrefix & "TOPICS ORDER BY T_VIEW_COUNT DESC"
replace with : if strDBType = "mysql" then strSql = "SELECT TOPIC_ID, T_SUBJECT, T_VIEW_COUNT,forum_id FROM " & strTablePrefix & "TOPICS ORDER BY T_VIEW_COUNT DESC LIMIT " & intLastSeen else strSql = "SELECT TOP " & intReadTopics & " TOPIC_ID, T_SUBJECT, T_VIEW_COUNT,forum_id FROM " & strTablePrefix & "TOPICS ORDER BY T_VIEW_COUNT DESC" end if |
|
|
Topic |
|