usernote database error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flashgordon
    Senior Member
    • Sep 2006
    • 206
    • 3.5.x

    usernote database error

    I started getting error emails some days ago:
    Database error in vBulletin 3.8.7:

    Invalid SQL:

    SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
    FROM vb_usernote AS usernote
    WHERE 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 3
    Error Number : 1064
    Request Date : Sunday, April 10th 2011 @ 11:11:56 PM
    Error Date : Sunday, April 10th 2011 @ 11:11:57 PM
    Script : /forum/member.php?u=75963
    Referrer :
    IP Address : XX.XX.XX.XX
    Username : Unregistered
    Classname : vB_Database
    MySQL Version :
    I checked as guest and the profiles indeed are inaccessible.

    I remember making changes to the usernote permissions recently.
    I turned the usernote permissions off for everybody.
    But I did not touch the permissions for unregistered users. And they were set to off anyway.

    I have now wrapped quotes around the userid in the query:
    SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
    FROM vb_usernote AS usernote
    WHERE userid = '';
    That should fix the problem for now.

    A couple of questions:

    What could cause the userid to be empty?
    Why are the usernotes queried anyway, if they are turned off?


    Now that I have fixed the usernote error, I receive these error emails:
    SELECT user.userid, user.username, user.usergroupid, user.displaygroupid, profilevisitor.visible, user.infractiongroupid

    FROM vb_profilevisitor AS profilevisitor
    INNER JOIN vb_user AS user ON (user.userid = profilevisitor.visitorid)

    WHERE profilevisitor.userid =
    AND (visible = 1 OR profilevisitor.visitorid = 0)

    ORDER BY profilevisitor.dateline DESC
    LIMIT 10;

    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 OR profilevisitor.visitorid = 0)

    Script : /forum/member.php?u=80491
    I don't get it. What could cause the userid to be lost?
    Last edited by flashgordon; Mon 11 Apr '11, 1:59am.
  • flashgordon
    Senior Member
    • Sep 2006
    • 206
    • 3.5.x

    #2
    I have deactivated all plugins with the config.php hook.

    When I visit a member's profile (not being logged in), I receive the vbulletin error notice:
    "Invalid User specified. If you followed a valid link, please notify the administrator"
    [ in /forum/member.php?u=40204 ]
    The url that I visited certainly is correct!

    Comment

    • flashgordon
      Senior Member
      • Sep 2006
      • 206
      • 3.5.x

      #3
      Strange. Now it's working again. I think it could maybe be due to an out-of-date cache item in memcached.

      Comment

      • Trevor Hannant
        vBulletin Support
        • Aug 2002
        • 24359
        • 5.7.X

        #4
        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 plugins.

        Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

        define('DISABLE_HOOKS', true);

        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?
        Vote for:

        - Admin Settable Paid Subscription Reminder Timeframe (vB6)
        - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

        Comment

        • flashgordon
          Senior Member
          • Sep 2006
          • 206
          • 3.5.x

          #5
          No.

          Could this be due to a faulty entry in the vb_user table?
          Or a cookie problem?

          I get error messages for users which are not logged in all over the forum.
          Like for example this one. It's always the userid that is not set.
          Code:
          Database error in vBulletin 3.8.7:
          
          Invalid SQL:
          
          		SELECT
          			socialgroup.groupid,
          			socialgroup.name,
          			socialgroup.description,
          			socialgroup.picturecount,
          			socialgroup.lastpost,
          			socialgroup.lastposter,
          			socialgroup.lastposterid,
          			socialgroup.lastgmid,
          			socialgroup.visible,
          			socialgroup.lastdiscussion,
          			socialgroup.discussions,
          			socialgroup.members,
          			socialgroupicon.dateline
          		FROM vb_socialgroup as socialgroup
          		INNER JOIN vb_socialgroupmember as socialgroupmember
          			ON socialgroup.groupid = socialgroupmember.groupid
          	   	LEFT JOIN vb_socialgroupicon as socialgroupicon
          			ON socialgroupicon.groupid = socialgroup.groupid
          		WHERE socialgroupmember.userid = 
          		GROUP BY name
          		ORDER BY lastpost DESC
          		LIMIT 6;
          
          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 'GROUP BY name
          		ORDER BY lastpost DESC
          		LIMIT 6' at line 21
          Error Number  : 1064
          Request Date  : Wednesday, April 13th 2011 @ 02:41:37 PM
          Error Date    : Wednesday, April 13th 2011 @ 02:41:37 PM
          Script        : /forum/
          Referrer      : 
          IP Address    : 92.231.65.63
          Username      : 
          Classname     : vB_Database
          MySQL Version :

          Comment

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

            #6
            Invalid SQL errors are almost always related to modified code. The next step is to follow Trevor's instructions.
            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...