Announcement

Collapse
No announcement yet.

Database Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database Error

    Ok.
    I have delt with VB alot, I even customize it with plugins and template editing, but now I get this error when I log in, even though I have no avatar.
    And PS: No, I made no alterations around the time this started, i have no idea why it showed up, just one day it was there.

    Code:
    Database error in vBulletin 3.5.4:
    
    Invalid SQL:
    
            SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
                customavatar.width, customavatar.height
            FROM user AS user
            LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
            LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
            WHERE user.userid =;
    
    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 '' at line 6
    Error Number : 1064
    Date         : Monday, June 12th 2006 @ 06:48:29 PM
    Script       : http://xxx.com/
    Referrer     : 
    IP Address   : xx.xxx.xxx.xxx
    Username     : Sparks
    Classname    : vb_database
    So, my question is, why is it giving me this?
    Nearest I can tell the user. table is fine.

    Any suggestions?

  • #2
    SQL Syntax errors are almost always related to modified code. To troubleshoot this, the first thing you need to do is remove any hacks or plugins, then see if you still have this problem.

    If so, reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server.

    Next, create a new style and choose no parent style. This will force it to use the default templates. Finally empty your browser cache, close all browser windows then try again. Make sure you change to the new style and view your forums with it. Do you have the same problem?
    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


    • #3
      Hi.
      I have done this.
      I re-uploaded the files, and for note, I never change and files, just plugins and templates.
      But as I mentioned, no modifications have been made within weeks before this happened.

      Comment


      • #4
        Are you still having this problem? I've never run into a situation where an SQL Syntax error occured with the original vB code, files and templates - except for rare instances where there are major bugs in MySQL itself.
        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


        • #5
          yes...

          I uploaded a fresh download of code and xml to the server, pointed it to my databse, and deleted install.php and still get the same error.

          so I ran install.php and erased my db, installed all from scratch, upon login I get the same error.
          However, if I am not logged in, im fine.

          Comment


          • #6
            It's got to be a server issue then. Which versions of PHP and MySQL are you running?
            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


            • #7
              Server Type
              FreeBSD

              Web Server
              Apache v1.3.33

              PHP
              4.4.1

              PHP Max Post Size
              8.00 MB

              PHP Maximum Upload Size
              2.00 MB

              MySQL Version
              4.0.16

              MySQL Packet Size
              2.00 MB


              My Web-Host claims there is nothing wrogn withthe SQL, and oddly enough, none of my other php/mysql scripts are malfunctioning.

              Comment


              • #8
                Well this is still either due to a code change you've made, or a server issue. There really are no other options. I suggest again reuploading the original files, reverting your custom templates and disabling your plugins.
                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


                • #9
                  Now this is really odd.
                  I went to talk to one of my co admins and said "sorry for the downtime, but im working on it"
                  And he looks at me like im a complete idiot.

                  So we clear all authenticate info (ie: cache, cookies, auth sessions, history,) everything, and he logs in, and hes fine.
                  Clear all data, and I log in, poof, instant error.
                  so there must be an issue with my entry in 'user'.

                  Now I am id=1, the ultra admin right.
                  If I delete myself via the admin panel, ( I am not set to untouchable in config)
                  and then re-register, the onyl issue I see then is, how do I get back to beign id 1 without causing dependency issues in different tables?

                  --Kelly

                  Comment


                  • #10
                    You cannot regain userid 1 without a lost of manipulation of the database. Frankly it's not worth the trouble. I'm userid 59 on my own forums.
                    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


                    • #11
                      Alright, so get this.
                      In close, let me tell you what happened, and how I fixed it.

                      When going through the database, looking in EVERY table, it hit me, the fact that the query was selecting avatar from user and was calling no userid.
                      So thinking, index.php and what not, I went into the admin panel, and disabled a plugin that was to put new PMs on forumhome when you havent read them.
                      Now normally this isnt an issue, however the user that sent me that PM, had since deleted himself, and therfore was calling no userid, and bam, SQL error.

                      Lesson learned, disable all plugins as well as products.

                      --Kelly

                      Comment

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