No announcement yet.

New database error

  • Filter
  • Time
  • Show
Clear All
new posts

  • New database error

    hi when i hit new post or unread post i get the database error page heres what its says in my email too.

    Database error in vBulletin 3.8.7:
    Invalid SQL:
             SELECT user.avatarid, user.avatarrevision, avatarpath, NOT  ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
                customavatar.width, customavatar.height, customavatar.width_thumb, customavatar.height_thumb
            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
    so anyone know how i can fix this thanks.

  • #2
    Invalid SQL errors are almost always related to modified code.

    To troubleshoot this, first 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. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

    Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

    [Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

    Next, disable all products:

    Admin CP -> Plugins & Products -> Manage Products -> Disable

    Then manually uncheck all plugins that are not for 'vBulletin Blog' and vBulletin CMS' here:

    Admin CP -> Plugins & Products -> Plugin Manager

    Then if you still have this problem, 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.


    • #3
      i also have the same problem. i reported it as a bug here

      o fix yet

      did u ever find a fix to the problem?

      the plugins i have installed have nothing to do with the error based on my research. they are only vbseo, display reputation in member profile, cyb paypal donate, and cyb advanced stats

      the problem appears to be in functions.php

      in this function

      function fetch_userinfo(&$userid, $option = 0, $languageid = 0)

      where for some reason, userid is being set to blank


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