1064 Error: Guests Cannot Register

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • L-Mane
    Senior Member
    • Sep 2002
    • 286
    • 3.6.x

    [Forum] 1064 Error: Guests Cannot Register

    I saw that I hadn't had any new users in weeks and then saw the E-Mails about the error. I disabled and uninstalled all plugins, re-installed VB, and it still happens.

    Database error in vBulletin 4.0.3:

    Invalid SQL:

    SELECT
    SUM(IF(lastvisit >= 1271062716, 1, 0)) AS active,
    COUNT(*) AS users,
    MAX(userid) AS maxid
    FROM user
    WHERE;

    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
    Request Date : Wednesday, May 12th 2010 @ 04:58:36 AM
    Error Date : Wednesday, May 12th 2010 @ 04:58:36 AM
    Script : http://www.wordofsouth.com/myblock/register.php?do=addmember
    Referrer : http://www.wordofsouth.com/myblock/register.php
    IP Address :
    Username : yotsisit
    Classname : vB_Database
    MySQL Version : 4.1.22-standard
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    That is from the functions_databuild.php page and this query:
    Code:
        $members = $vbulletin->db->query_first("
            SELECT
            $sumsql
            COUNT(*) AS users,
            MAX(userid) AS maxid
            FROM " . TABLE_PREFIX . "user
            WHERE
            usergroupid NOT IN (3,4)
        ");
    If you are going to remove the usergroup line, you need to remove the WHERE also:
    Code:
        $members = $vbulletin->db->query_first("
            SELECT
            $sumsql
            COUNT(*) AS users,
            MAX(userid) AS maxid
            FROM " . TABLE_PREFIX . "user
        ");

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • L-Mane
      Senior Member
      • Sep 2002
      • 286
      • 3.6.x

      #3
      I got this error when I followed your directions.
      Code:
      Invalid SQL:
      SELECT userid, username FROM user WHERE userid = 22023 AND;
       
      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 1
      then
      Code:
      Invalid SQL:
      SELECT userid, username FROM user  userid = 22024 AND;
      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 '= 22024 AND' at line 1

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #4
        The query I wrote above looks nothing like the one you are having problems with. Did you make sure to modify the correct query? It's in the build_user_statistics function.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools <- awesome site for html/css help

        Comment

        • L-Mane
          Senior Member
          • Sep 2002
          • 286
          • 3.6.x

          #5
          Ok, I might not be following you correctly. I have to do what you said somewhere else other then editing functions_databuild.php manually?

          Comment

          • Lynne
            Former vBulletin Support
            • Oct 2004
            • 26255

            #6
            It looks like you had already edited that file and done so incorrectly. You may want to just download a fresh version from the members area and upload it. Or, find the exact query I am talking about and edit it correctly (are you sure you did the correct one?). I cannot find any query like the one you posted in post 3. So, I'd suggest disabling your plugins and seeing if this error goes away.
            Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

            PHP Code:
            define('DISABLE_HOOKS'true); 

            Please don't PM or VM me for support - I only help out in the threads.
            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
            Want help modifying your vbulletin forum? Head on over to vbulletin.org
            If I post CSS and you don't know where it goes, throw it into the additional.css template.

            W3Schools &lt;- awesome site for html/css help

            Comment

            • L-Mane
              Senior Member
              • Sep 2002
              • 286
              • 3.6.x

              #7
              Thank you for your help. Problem fixed :-)

              Comment

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