"You have an error in your SQL syntax"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bilco105
    Member
    • Jun 2003
    • 33

    "You have an error in your SQL syntax"

    Hi,

    When viewing the newest thread in a forum, I am getting this error...

    Database error in vBulletin 3.0.3:

    Invalid SQL:
    SELECT threadid
    FROM thread AS thread
    LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
    WHERE forumid IN () AND visible = 1 AND (sticky = 1 OR sticky = 0)
    AND lastpost >= -30 AND open <> 10 AND deletionlog.primaryid IS NULL
    ORDER BY lastpost DESC
    LIMIT 1

    mysql error: 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 ') AND visible = 1 AND (sticky = 1 OR sticky = 0)
    AND lastpo

    mysql error number: 1064

    Date: Thursday 09th of December 2004 11:21:11 AM
    Script: http://www.amsterdamaged.net/forums/...ost&forumid=29
    Referer:
    Username: bilco105
    IP Address: xx.xx.xx.xxx
    Now, I have not touched this (or atleast I dont think I have) however I have imported from another system using impex.

    Any ideas?
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    Go into the AdminCP > Import & Maitence > Repair / Optmize Database > Check All, hit continue.


    Then go to Forums & Moderators > Forum Manager > Edit a forum and save.

    Comment

    • bilco105
      Member
      • Jun 2003
      • 33

      #3
      Then go to Forums & Moderators > Forum Manager > Edit a forum and save.
      Just one forum, Or all the ones I am having problems with.

      Thanks for the awesomely fast responce by the way

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        Anyone, I am gessing the forumid's were not properly rebuilt after the import. So I am guessing that this may fix it, it may not however.

        Comment

        • bilco105
          Member
          • Jun 2003
          • 33

          #5
          Thanks for your help..

          Unfortunetly the error is still occuring

          Comment

          • Zachery
            Former vBulletin Support
            • Jul 2002
            • 59097

            #6
            And you are still using all stock templates and files?

            Comment

            • bilco105
              Member
              • Jun 2003
              • 33

              #7
              I havn't installed any hacks to produce that error, I have two installed over the past 20minutes though, but the error was already occuring.

              I have a custom template from cpstyles or something like that

              Comment

              • Zachery
                Former vBulletin Support
                • Jul 2002
                • 59097

                #8
                1. Restore all ORIGINAL FILES, we do not provide support for hacked instalitions, and as it was working prior to the hacks I can only assume its them

                2. Add a new style with no parrent

                AdminCP > Styles & Templates > Style Manager > [ Add New Style ]

                Change to the new style and see if the bug is still happening

                Comment

                • bilco105
                  Member
                  • Jun 2003
                  • 33

                  #9
                  I will do a second install and use the same database, We can see if there are any errors that way.

                  Comment

                  • Zachery
                    Former vBulletin Support
                    • Jul 2002
                    • 59097

                    #10
                    A second install ont he same database is not going to fix the issue, as it will probaly whipe out your forums, it will be much simpler to just upload the default files and create a defautl style.

                    Comment

                    • bilco105
                      Member
                      • Jun 2003
                      • 33

                      #11
                      The reason I'm installing it the files, Is because its only the files I have modified.

                      The theme has no relation to a mysql database, I have the new files and am getting exactly the same error



                      However, I have not changed the theme because for some reason it wont allow me to upload the default theme aswell.

                      But as I mentioned, I havn;t changed anything in the theme that would affect a mysql statement

                      Comment

                      • Steve Machol
                        Former Customer Support Manager
                        • Jul 2000
                        • 154488

                        #12
                        Reupload the original showthread.php file from the vB zip file. Make sure you upload in ASCII and overwrite the one on the server.
                        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                        Change CKEditor Colors to Match Style (for 4.1.4 and above)

                        Steve Machol Photography


                        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...