New Posts New Posts RSS Feed - MySQL problem with latest topics 1.02
  FAQ FAQ  Forum Search   Register Register  Login Login

MySQL problem with latest topics 1.02

 Post Reply Post Reply
Author
claust View Drop Down
Newbie
Newbie


Joined: 04 Dec 2008
Status: Offline
Points: 3
Post Options Post Options   Quote claust Quote  Post ReplyReply Direct Link To This Post Topic: MySQL problem with latest topics 1.02
    Posted: 04 Dec 2008 at 3:50pm
Hi,

I am getting this error;

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.0.67]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 '10 tblForum.Forum_ID, tblForum.Forum_name, tblTopic.Topic_ID, tblTopic.Subject, ' at line 1

/forum/includes/s2h_latest-topics.asp, line 59

----

The SQL prints out;

SELECT TOP 10 tblForum.Forum_ID, tblForum.Forum_name, tblTopic.Topic_ID, tblTopic.Subject, tblThread.Thread_ID, tblThread.Message_date, tblAuthor.Author_ID, tblAuthor.Username, tblThread.Message FROM tblForum, tblTopic, tblAuthor, tblThread WHERE tblForum.Forum_ID = tblTopic.Forum_ID AND tblTopic.Last_Thread_ID = tblThread.Thread_ID AND tblAuthor.Author_ID = tblThread.Author_ID AND (tblTopic.Forum_ID IN (SELECT tblPermissions.Forum_ID FROM tblPermissions WHERE (tblPermissions.Group_ID = 2) AND tblPermissions.View_Forum = -1))AND (tblForum.Password = '' OR tblForum.Password Is Null) AND (tblTopic.Hide = 0 AND tblThread.Hide = 0) ORDER BY tblThread.Thread_ID DESC

------

I tried editing the SQL to 'select * ....' and 'limit 0,10' but no luck, is this mod for MSSQL only, or am I doing something wrong??

Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 05 Dec 2008 at 7:11am
Unfortunately, I do not run any forums under MySQL so I don't have want to test it under - so yes my mods do get made for MSSQL mostly.

I will setup a temporary MySQL test forum and make it MySQL compatible.


Edited by Scotty32 - 05 Dec 2008 at 7:12am
Back to Top
claust View Drop Down
Newbie
Newbie


Joined: 04 Dec 2008
Status: Offline
Points: 3
Post Options Post Options   Quote claust Quote  Post ReplyReply Direct Link To This Post Posted: 05 Dec 2008 at 2:11pm
Thanks a lot, much appreciated :-) Thumbs%20Up
Back to Top
claust View Drop Down
Newbie
Newbie


Joined: 04 Dec 2008
Status: Offline
Points: 3
Post Options Post Options   Quote claust Quote  Post ReplyReply Direct Link To This Post Posted: 06 Dec 2008 at 10:13am
Solved it, the SQL statement for MySQL should read ;

SELECT tblForum.Forum_ID, tblForum.Forum_name, tblTopic.Topic_ID, tblTopic.Subject, tblThread.Thread_ID, tblThread.Message_date, tblAuthor.Author_ID, tblAuthor.Username, tblThread.Message FROM tblForum, tblTopic, tblAuthor, tblThread WHERE tblForum.Forum_ID = tblTopic.Forum_ID AND tblTopic.Last_Thread_ID = tblThread.Thread_ID AND tblAuthor.Author_ID = tblThread.Author_ID AND (tblTopic.Forum_ID IN (SELECT tblPermissions.Forum_ID FROM tblPermissions WHERE (tblPermissions.Group_ID = 2) AND tblPermissions.View_Forum = -1))AND (tblForum.Password = '' OR tblForum.Password Is Null) AND (tblTopic.Hide = 0 AND tblThread.Hide = 0) ORDER BY tblThread.Thread_ID DESC limit 0,10

This works :-)
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 13 Dec 2008 at 3:28pm
I have now updated the Latest Topics to add support for MySQL Database.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.