Database Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahmedzedan
    Member
    • Apr 2020
    • 42

    Database Error


    I have the same problem after upgrading to 5.7.5



    Error Invalid SQL: SELECT u.userid, u.options, u.username AS username, u.displayname, u.usergroupid AS usergroupid, u.displaygroupid, u.infractiongroupid, u.usertitle, u.customtitle, IFNULL(u.lastactivity, u.joindate) as lastactivity, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 34316 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'yes'), 0) as isFollowing, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 34316 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'pending'), 0) as isPending FROM user AS u INNER JOIN userlist AS ul ON (u.userid = ul.userid AND ul.relationid = 34316) WHERE ul.type = 'follow' AND ul.friend = 'yes' ORDER BY username ASC LIMIT 0, 100;
    استثناء الاستثناء :
    ## phar:///home1//public_html/vb/core/vb/vb.phar/database.php(1) Exception Thrown #0 phar:///home1//public_html/vb/core/vb/vb.phar/database/mysqli.php(1): vB_Database->halt() #1 phar:///home1//public_html/vb/core/vb/vb.phar/database.php(1): vB_Database_MySQLi->execute_query(true, Object(mysqli)) #2 phar:///home1//public_html/vb/core/vb/vb.phar/db/result.php(1): vB_Database->query_read('Invalid SQL:\r\nS...', true) #3 phar:///home1//public_html/vb/core/vb/vb.phar/db/result.php(1): vB_dB_Result->rewind() 4.X /home1//public_html/vb/core/packages/vbforum/db/mysql/querydefs.php(7156): vB_dB_Result->__construct(Object(vB_Database_MySQLi), 'SELECT u.userid...') 5.X phar:///home1//public_html/vb/core/vb/vb.phar/db/query/method.php(1): vBForum_dB_MYSQL_QueryDefs->getUserFollowers(Array, Object(vB_Database_MySQLi), false, false) #6 phar:///home1//public_html/vb/core/vb/vb.phar/db/assertor.php(1): vB_dB_Query_Method->execSQL() #7 phar:///home1//public_html/vb/core/vb/vb.phar/db/assertor.php(1): vB_dB_Assertor->assertQuery('vBForum:getUser...', Array, false) #8 phar:///home1//public_html/vb/core/vb/vb.phar/library/follow.php(2): vB_dB_Assertor->getRows('vBForum:getUser...', Array) #9 phar:///home1//public_html/vb/core/vb/vb.phar/api/user.php(1): vB_Library_Follow->getFollowers(34316) #10 phar:///home1//public_html/vb/core/vb/vb.phar/api/user.php(1): vB_Api_User->fetchProfileInfo(34316) #11 phar:///home1//public_html/vb/core/vb/vb.phar/api/wrapper.php(1): vB_Api_User->getNamecardInfo('34316') #12 /home1//public_html/vb/includes/api/interface/collapsed.php(105): vB_Api_Wrapper->__call('getNamecardInfo', Array) #13 /home1//public_html/vb/includes/vb5/template/runtime.php(1034): Api_Interface_Collapsed->callApi('user', 'getNamecardInfo', Array, false, true) #14 /home1//public_html/vb/includes/vb5/template.php(404) : eval()'d code(46): vB5_Template_Runtime:arseData('user', 'getNamecardInfo', '34316') #15 /home1//public_html/vb/includes/vb5/template.php(404): eval() #16 /home1//public_html/vb/includes/vb5/template/cache.php(137): vB5_Template->render(false) #17 /home1//public_html/vb/includes/vb5/template.php(426): vB5_Template_Cache->replacePlaceholders('\r\n\r\n\r\n\r\n<div cl...') #18 /home1//public_html/vb/includes/vb5/template/cache.php(137): vB5_Template->render(false)
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73412
    • 6.0.X

    #2
    This query isn't related to the original post of the topic it was in. It can be a completely different issue. I've moved it to its own topic.


    What version of MySQL and PHP are you using?
    What is actual the MySQL error line?
    Last edited by Wayne Luke; Mon 25 Sep '23, 9:49am.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • ahmedzedan
      Member
      • Apr 2020
      • 42

      #3

      Sorry for the delay in replying as I was sick

      I upgraded from 5.6.4 to 5.6.9 php8

      Without any errors in the upgrade, I also have an error in the databases

      I cannot solve the problem, please help


      --------------------------------------------------------------------------------------------
      ​ Error Invalid SQL: SELECT u.userid, u.options, u.username AS username, u.displayname, u.usergroupid AS usergroupid, u.displaygroupid, u.infractiongroupid, u.usertitle, u.customtitle, IFNULL(u.lastactivity, u.joindate) as lastactivity, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 64134 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'yes'), 0) as isFollowing, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 64134 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'pending'), 0) as isPending FROM user AS u INNER JOIN userlist AS ul ON (u.userid = ul.userid AND ul.relationid = 64134) WHERE ul.type = 'follow' AND ul.friend = 'yes' ORDER BY username ASC LIMIT 0, 100;
      استثناء الاستثناء :


      ​phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/database.php(1190) Exception Thrown
      #0 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/database/mysqli.php(236): vB_Database->halt()
      #1 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/database.php(587): vB_Database_MySQLi->execute_query(true, Object(mysqli))
      #2 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/db/result.php(148): vB_Database->query_read('Invalid SQL:\r\nS...', true)
      #3 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/db/result.php(68): vB_dB_Result->rewind()
      4.X /home1/oneoneo/public_html/vb/core/packages/vbforum/db/mysql/querydefs.php(7014): vB_dB_Result->__construct(Object(vB_Database_MySQLi), 'SELECT u.userid...')
      5.X phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/db/query/method.php(67): vBForum_dB_MYSQL_QueryDefs->getUserFollowers(Array, Object(vB_Database_MySQLi), false, false)
      #6 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/db/assertor.php(245): vB_dB_Query_Method->execSQL()
      #7 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/db/assertor.php(593): vB_dB_Assertor->assertQuery('vBForum:getUser...', Array, false)
      #8 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/api/follow.php(221): vB_dB_Assertor->getRows('vBForum:getUser...', Array)
      #9 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/api/user.php(181): vB_Api_Follow->getFollowers(64134)
      #10 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/api/user.php(7125): vB_Api_User->fetchProfileInfo(64134)
      #11 phar:///home1/oneoneo/public_html/vb/core/vb/vb.phar/api/wrapper.php(205): vB_Api_User->getNamecardInfo('64134')
      #12 /home1/oneoneo/public_html/vb/includes/api/interface/collapsed.php(105): vB_Api_Wrapper->__call('getNamecardInfo', Array)
      #13 /home1/oneoneo/public_html/vb/includes/vb5/template/runtime.php(1034): Api_Interface_Collapsed->callApi('user', 'getNamecardInfo', Array, false, true)
      #14 /home1/oneoneo/public_html/vb/includes/vb5/template.php(404) : eval()'d code(46): vB5_Template_Runtime:arseData('user', 'getNamecardInfo', '64134')
      #15 /home1/oneoneo/public_html/vb/includes/vb5/template.php(404): eval()​

      Comment

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

        #4
        Unfortunately that doesn't give the full error. Please place your site into Debug mode then try again. This should give the full error.
        Vote for:

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

        Comment

        • ahmedzedan
          Member
          • Apr 2020
          • 42

          #5
          Originally posted by Trevor Hannant
          Unfortunately that doesn't give the full error. Please place your site into Debug mode then try again. This should give the full error.

          I don't understand you

          Please place your site into Debug mode then try again


          ​There are errors in the attachments error_log​

          Attached Files

          Comment

          • ahmedzedan
            Member
            • Apr 2020
            • 42

            #6
            Error Database error in vBulletin 5.6.9: Invalid SQL: SELECT u.userid, u.options, u.username AS username, u.displayname, u.usergroupid AS usergroupid, u.displaygroupid, u.infractiongroupid, u.usertitle, u.customtitle, IFNULL(u.lastactivity, u.joindate) as lastactivity, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 214123 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'yes'), 0) as isFollowing, IFNULL((SELECT userid FROM userlist AS ul2 WHERE ul2.userid = 214123 AND ul2.relationid = u.userid AND ul2.type = 'follow' AND ul2.friend = 'pending'), 0) as isPending FROM user AS u INNER JOIN userlist AS ul ON (u.userid = ul.userid AND ul.relationid = 214123) WHERE ul.type = 'follow' AND ul.friend = 'yes' ORDER BY username ASC LIMIT 0, 100; MySQL Error : Unknown column 'u.infractiongroupid' in 'field list' Error Number : 1054 Request Date : Friday, October 27th 2023 @ 09:06:40 PM Error Date : Friday, October 27th 2023 @ 09:06:44 PM Script : Referrer : IP Address : 41.199.32.33 Username : ahmedzedan Classname : vB_Database_MySQLi MySQL Version : 5.7.23-23



            In the admincp panel it gives


            SQL Queries (40) | $RCSfile$ - $Revision: 109444 $ | Explain

            Memory Usage: 10,585 KiB

            Comment

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

              #7
              This is the actual error here which was not in your post (post 3):

              Code:
              MySQL Error : Unknown column 'u.infractiongroupid' in 'field list'
              Can you run the following query in your phpMyAdmin to add that column then try again:

              Code:
              ALTER TABLE `user`
              ADD COLUMN infractiongroupid SMALLINT UNSIGNED NOT NULL DEFAULT '0' AFTER infractiongroupids;
              Your screenshot is unrelated - these are PHP warnings, not a Database Error. On a production site, you should have these warnings turned off.
              Vote for:

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

              Comment

              • ahmedzedan
                Member
                • Apr 2020
                • 42

                #8

                Many thanks from me and Egypt to you. Some pages are wrong and some are well done



                Error Database error in vBulletin 5.6.9: Invalid SQL: /* Channels */ SELECT follow.title AS title, follow.nodeid AS keyval, 'node' AS sourcetable, IF(follow.lastcontent = 0, follow.lastupdate, follow.lastcontent) AS lastactivity, follow.totalcount AS activity, type.class AS type, (follow.nodeoptions & 512) AS noUnsubscribe FROM node AS follow INNER JOIN contenttype AS type ON type.contenttypeid = follow.contenttypeid INNER JOIN subscribediscussion AS sd ON sd.discussionid = follow.nodeid AND sd.userid = 8 UNION ALL /* Users */ SELECT follow.displayname AS title, follow.userid AS keyval, 'user' AS sourcetable, IFNULL(follow.lastpost, follow.joindate) AS lastactivity, follow.posts as activity, 'Member' AS type, 0 AS noUnsubscribe FROM user AS follow INNER JOIN userlist AS ul ON ul.relationid = follow.userid AND ul.userid = 8 WHERE ul.type = 'follow' AND ul.friend = 'yes' ORDER BY title ASC LIMIT 100 /** getUserFollowing**/; MySQL Error : Illegal mix of collations for operation 'UNION' Error Number : 1271 Request Date : Sunday, October 29th 2023 @ 10:06:52 PM Error Date : Sunday, October 29th 2023 @ 10:07:01 PM Script : Referre

                Comment

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

                  #9
                  Code:
                  MySQL Error : Illegal mix of collations for operation 'UNION'​
                  You have different table/column collations through your database. You should the 'dbtools' included in the 'do_not_upload' folder in the vBulletin ZIP file to convert your database to the same collation all through. Instructions on using these tools can be found here:

                  Vote for:

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

                  Comment

                  • ahmedzedan
                    Member
                    • Apr 2020
                    • 42

                    #10
                    Originally posted by Trevor Hannant
                    Code:
                    MySQL Error : Illegal mix of collations for operation 'UNION'​
                    You have different table/column collations through your database. You should the 'dbtools' included in the 'do_not_upload' folder in the vBulletin ZIP file to convert your database to the same collation all through. Instructions on using these tools can be found here:

                    https://forum.vbulletin.com/articles...database-tools

                    Thank you, dear sir, and God bless you.


                    Unfortunately, I do not have sufficient experience, as I am a donkey, and there is no explanation with pictures or video


                    Currently the forum is working without problems. look at the picture. It also gives an error and surprisingly the problem has been resolved






                    Attached Files

                    Comment


                    • Wayne Luke
                      Wayne Luke commented
                      Editing a comment
                      Glad you got it working.

                      However, our scripts were designed to protect the data. Just switching collations does not do that. The tools listed in the article aren't graphical tools so I am not sure how pictures and video would help. They are command line tools and the commands that fit 99% of all customers are listed in the document.
                  • ahmedzedan
                    Member
                    • Apr 2020
                    • 42

                    #11
                    Firstly, thank you. Strong topics are always supported with images or video for the following reasons. Some people do not fully master the English language or English terms and apply topics such as pictures or videos blindly, like me. Please add some pictures to the topic. Thank you for your patience

                    Comment

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

                      #12
                      There are no pictures we can show you - you would open an SSH connection to your server or, if your cPanel has it, Terminal then run the commands in the article. Having the commands listed there means that you can copy and paste these which you can't do from an image/video...
                      Vote for:

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

                      Comment

                      • eolesen
                        Senior Member
                        • Mar 2023
                        • 159

                        #13
                        Please execute this in a SQL window using PHPMyAdmin or the SQL command window in the AdminCP:


                        SHOW VARIABLES LIKE 'collation%';


                        Paste or screenshot the results. It should look like this:

                        Click image for larger version

Name:	Untitled.png
Views:	68
Size:	21.5 KB
ID:	4487051

                        Comment

                        • ahmedzedan
                          Member
                          • Apr 2020
                          • 42

                          #14
                          Error Database error in vBulletin 5.7.5: Invalid SQL: SELECT user.userid, user.username, user.displayname, user.usergroupid AS usergroupid, user.lastactivity, user.options, user.posts, user.joindate, user.usertitle,user.reputation, user.reputationlevelid, session.lastactivity AS lastvisit, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid, user.usergroupid FROM user AS user LEFT JOIN session AS session ON session.userid = user.userid WHERE usergroupid IN (34,37,38,6,10,2,32,39,23,29,31,28,11,15,7,5) GROUP BY user.userid ORDER BY user.displayname ASC LIMIT 0, 10 /** fetchMemberList**/;
                          MySQL Error : Column 'infractiongroupid' in field list is ambiguous Error Number : 1052
                          Request Date : Wednesday, November 1st 2023 @ 12:48:54 PM Error Date : Wednesday, November 1st 2023 @ 12:48:56 PM Script : https://www.111az.com/vb/memberlist Referrer : https://www.111az.com/vb/ IP Address : 41.199.24.103 Username : ahmedzedan Classname : vB_Database_MySQLi MySQL Version : 5.7.23-23



                          I'm sorry for bothering. There is a new error in the-- membership--- list. I also don't have permissions to see who's online now.
                          Attached Files

                          Comment

                          • Wayne Luke
                            vBulletin Technical Support Lead
                            • Aug 2000
                            • 73412
                            • 6.0.X

                            #15
                            This error typically occurs when two tables have the same field. That shouldn't be the case here. However, make sure your database's session table does not have an infractiongroupid field.
                            Translations provided by Google.

                            Wayne Luke
                            The Rabid Badger - a vBulletin Cloud demonstration site.
                            vBulletin 5 API

                            Comment

                            Related Topics

                            Collapse

                            Working...
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎