Error when hitting the Blog Subscriptions Button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Diggazz
    New Member
    • Mar 2005
    • 19

    Error when hitting the Blog Subscriptions Button

    Code:
     
    Database error in vBulletin 3.6.8:
    Invalid SQL:
       SELECT SQL_CALC_FOUND_ROWS blog_user.entries, comments, lastblog, lastblogid, lastblogtitle, blog_user.title, blog_subscribeuser.type, blog_user.ratingnum, blog_user.ratingtotal,
        user.username, user.userid, options_ignore, options_buddy, options_everyone, ignored.relationid AS ignoreid, buddy.relationid AS buddyid
       FROM vb3_blog_subscribeuser AS blog_subscribeuser
       INNER JOIN vb3_user AS user ON (user.userid = blog_subscribeuser.bloguserid)
       LEFT JOIN vb3_blog_user AS blog_user ON (blog_user.bloguserid = blog_subscribeuser.bloguserid)
       LEFT JOIN vb3_userlist AS buddy ON (buddy.userid = user.userid AND buddy.relationid = xxx AND buddy.type = 'buddy')
       LEFT JOIN vb3_userlist AS ignored ON (ignored.userid = user.userid AND ignored.relationid = xxx AND ignored.type = 'ignore')
       WHERE blog_subscribeuser.userid = xxx
       ORDER BY blog_user.lastblog DESC
       LIMIT 0, 20;
    MySQL Error  : Column 'comments' in field list is ambiguous
    Error Number : 1052
    Date         : Thursday, August 30th 2007 @ 01:33:48 AM
    Script       : [URL]http://www.xtremegamingnetwork.com.au/Forums/blog_subscription.php?do=userlist[/URL]
    Referrer     : [URL]http://www.xtremegamingnetwork.com.au/Forums/blog_usercp.php?do=editoptions[/URL]
    IP Address   : 
    Username     : Diggazz
    Classname    : vb_database

    Did I do something incorrectly ?
    Last edited by Diggazz; Wed 29 Aug '07, 9:37am. Reason: user id removed
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    In config.php try setting $config['Database']['force_sql_mode'] = false;
    to $config['Database']['force_sql_mode'] = true;

    Comment

    • Freddie Bingham
      Former vBulletin Developer
      • May 2000
      • 14057
      • 1.1.x

      #3
      You probably have a comments field in the user table from a hack. You'll need to remove it or rename it.

      Comment

      • Diggazz
        New Member
        • Mar 2005
        • 19

        #4
        Thanks

        Zachery - that had no effect

        Freddie - I will investigate this tomorrow as its 2.30 am here


        thank you both for your prompt response

        Comment

        • Marty1970
          New Member
          • Aug 2007
          • 10
          • 3.6.x

          #5
          I have the same error, but I'm confused @Freddie Bingham post, file blog_subscriptions.php requests this "comments" information :

          line 429
          PHP Code:
          SELECT SQL_CALC_FOUND_ROWS blog_user.entriescommentslastblog
          What exactly did you mean ?

          Comment

          • Zachery
            Former vBulletin Support
            • Jul 2002
            • 59097

            #6
            Do you have another comments table/row in your database?

            Comment

            • Marty1970
              New Member
              • Aug 2007
              • 10
              • 3.6.x

              #7
              File product-vbblog.xml creates this "comments" row on the blog_user table.

              Code:
              CREATE TABLE " . TABLE_PREFIX . "[B]blog_user[/B] (
                      bloguserid INT UNSIGNED NOT NULL DEFAULT '0',
                      title VARCHAR(255) NOT NULL DEFAULT '',
                      description MEDIUMTEXT NOT NULL,
                      allowsmilie SMALLINT UNSIGNED NOT NULL DEFAULT '1',
                      options INT UNSIGNED NOT NULL DEFAULT '0',
                      viewoption ENUM('all','only','except') NOT NULL DEFAULT 'all',
                      [COLOR=Red][B]comments[/B][/COLOR] INT UNSIGNED NOT NULL DEFAULT '0',
                      lastblog INT UNSIGNED NOT NULL DEFAULT '0',
                      lastblogid INT UNSIGNED NOT NULL DEFAULT '0',
                      lastblogtitle VARCHAR(255) NOT NULL DEFAULT '',
                      lastcomment INT UNSIGNED NOT NULL DEFAULT '0',
                      lastcommenter VARCHAR(100) NOT NULL DEFAULT '',
                      lastblogtextid INT UNSIGNED NOT NULL DEFAULT '0',
                      entries INT UNSIGNED NOT NULL DEFAULT '0',
                      deleted INT UNSIGNED NOT NULL DEFAULT '0',
                      moderation INT UNSIGNED NOT NULL DEFAULT '0',
                      draft INT UNSIGNED NOT NULL DEFAULT '0',
                      pending INT UNSIGNED NOT NULL DEFAULT '0',
                      ratingnum INT UNSIGNED NOT NULL DEFAULT '0',
                      ratingtotal INT UNSIGNED NOT NULL DEFAULT '0',
                      rating FLOAT UNSIGNED NOT NULL DEFAULT '0',
                      subscribeown ENUM('none', 'usercp', 'email') NOT NULL DEFAULT 'none',
                      subscribeothers ENUM('none', 'usercp', 'email') NOT NULL DEFAULT 'none',
                      uncatentries INT UNSIGNED NOT NULL DEFAULT '0',
                      akismet_key VARCHAR(15) NOT NULL DEFAULT '',
                      options_everyone INT UNSIGNED NOT NULL DEFAULT '0',
                      options_buddy INT UNSIGNED NOT NULL DEFAULT '0',
                      options_ignore INT UNSIGNED NOT NULL DEFAULT '0',
                      isblogmoderator SMALLINT UNSIGNED NOT NULL DEFAULT '0',
                      comments_moderation INT UNSIGNED NOT NULL DEFAULT '0',
                      comments_deleted INT UNSIGNED NOT NULL DEFAULT '0',
                      PRIMARY KEY  (bloguserid),
                      KEY lastblog (lastblog, entries),
                      KEY ratingnum (ratingnum, rating)
                  )
              ");
              Thus as above with this error.
              Code:
              Database error in vBulletin 3.6.8:
              
              Invalid SQL:
              
                          SELECT SQL_CALC_FOUND_ROWS [B]blog_user[/B].entries, [B][COLOR=Red]comments[/COLOR][/B], lastblog, lastblogid, lastblogtitle, blog_user.title, blog_subscribeuser.type, blog_user.ratingnum, blog_user.ratingtotal,
                              user.username, user.userid, options_ignore, options_buddy, options_everyone, ignored.relationid AS ignoreid, buddy.relationid AS buddyid
                          FROM blog_subscribeuser AS blog_subscribeuser
                          INNER JOIN user AS user ON (user.userid = blog_subscribeuser.bloguserid)
                          LEFT JOIN blog_user AS blog_user ON (blog_user.bloguserid = blog_subscribeuser.bloguserid)
                          LEFT JOIN userlist AS buddy ON (buddy.userid = user.userid AND buddy.relationid = 1 AND buddy.type = 'buddy')
                          LEFT JOIN userlist AS ignored ON (ignored.userid = user.userid AND ignored.relationid = 1 AND ignored.type = 'ignore')
                          WHERE blog_subscribeuser.userid = 1
                          ORDER BY blog_user.lastblog DESC
                          LIMIT 0, 20;
              
              MySQL Error  : Column '[B][COLOR=Red]comments[/COLOR][/B]' in field list is ambiguous
              Error Number : 1052
              Date         : Thursday, August 30th 2007 @ 02:36:10 AM
              Script       : http://gamers-crib.com/blog_subscription.php?do=userlist
              Referrer     : http://gamers-crib.com/blog_usercp.php
              IP Address   : 87.232.32.46
              Username     : Marty
              Classname    : vB_Database
              Which is called from file blog_subscription.php line 429

              Code:
              SELECT SQL_CALC_FOUND_ROWS [B]blog_user[/B].entries, [B][COLOR=Red]comments[/COLOR][/B], lastblog, lastblogid, lastblogtitle, blog_user.title, blog_subscribeuser.type, blog_user.ratingnum, blog_user.ratingtotal,
              So with that in mind are we talking about the same database table.

              This is a brand new installation from release vBulletin Blog 1.0.0

              Comment

              • Diggazz
                New Member
                • Mar 2005
                • 19

                #8
                Originally posted by Freddie Bingham
                You probably have a comments field in the user table from a hack. You'll need to remove it or rename it.
                No this is not the case

                No hacks installed that have a comments field in this new table

                This is my first Blog software installation and no other hacks use table prefix vb3_blog_

                Comment

                • FBJunkie
                  Member
                  • Oct 2006
                  • 71
                  • 3.8.x

                  #9
                  I am getting this error when clicking on the Blog Subscriptions button. Is there a fix to this?


                  PHP Code:
                  Database error in vBulletin 3.6.8:
                  Invalid SQL:
                  SELECT SQL_CALC_FOUND_ROWS blog_user.entriescommentslastbloglastblogidlastblogtitleblog_user.titleblog_subscribeuser.typeblog_user.ratingnumblog_user.ratingtotal,
                  user.usernameuser.useridoptions_ignoreoptions_buddyoptions_everyoneignored.relationid AS ignoreidbuddy.relationid AS buddyid
                  FROM vb_blog_subscribeuser 
                  AS blog_subscribeuser
                  INNER JOIN vb_user 
                  AS user ON (user.userid blog_subscribeuser.bloguserid)
                  LEFT JOIN vb_blog_user AS blog_user ON (blog_user.bloguserid blog_subscribeuser.bloguserid)
                  LEFT JOIN vb_userlist AS buddy ON (buddy.userid user.userid AND buddy.relationid AND buddy.type 'buddy')
                  LEFT JOIN vb_userlist AS ignored ON (ignored.userid user.userid AND ignored.relationid AND ignored.type 'ignore')
                  WHERE blog_subscribeuser.userid 1
                  ORDER BY blog_user
                  .lastblog DESC
                  LIMIT 0
                  30;
                  MySQL Error Column 'comments' in field list is ambiguous
                  Error Number 
                  1052
                  Date 
                  ThursdayAugust 30th 2007 10:08:04 AM
                  Script 
                  http://www.mywebsite.com/forums/blog_subscription.php?do=userlist
                  Referrer http://www.mywebsite.com/forums/blog_subscription.php?do=entrylist
                  IP Address : **********
                  Username myusername
                  Classname 
                  vB_Database 

                  Comment

                  • Marty1970
                    New Member
                    • Aug 2007
                    • 10
                    • 3.6.x

                    #10
                    Originally posted by FBJunkie
                    I am getting this error when clicking on the Blog Subscriptions button. Is there a fix to this?


                    PHP Code:
                    Database error in vBulletin 3.6.8:
                    Invalid SQL:
                    SELECT SQL_CALC_FOUND_ROWS blog_user.entriescommentslastbloglastblogidlastblogtitleblog_user.titleblog_subscribeuser.typeblog_user.ratingnumblog_user.ratingtotal,
                    user.usernameuser.useridoptions_ignoreoptions_buddyoptions_everyoneignored.relationid AS ignoreidbuddy.relationid AS buddyid
                    FROM vb_blog_subscribeuser 
                    AS blog_subscribeuser
                    INNER JOIN vb_user 
                    AS user ON (user.userid blog_subscribeuser.bloguserid)
                    LEFT JOIN vb_blog_user AS blog_user ON (blog_user.bloguserid blog_subscribeuser.bloguserid)
                    LEFT JOIN vb_userlist AS buddy ON (buddy.userid user.userid AND buddy.relationid AND buddy.type 'buddy')
                    LEFT JOIN vb_userlist AS ignored ON (ignored.userid user.userid AND ignored.relationid AND ignored.type 'ignore')
                    WHERE blog_subscribeuser.userid 1
                    ORDER BY blog_user
                    .lastblog DESC
                    LIMIT 0
                    30;
                    MySQL Error Column 'comments' in field list is ambiguous
                    Error Number 
                    1052
                    Date 
                    ThursdayAugust 30th 2007 10:08:04 AM
                    Script 
                    http://www.mywebsite.com/forums/blog_subscription.php?do=userlist
                    Referrer http://www.mywebsite.com/forums/blog_subscription.php?do=entrylist
                    IP Address : **********
                    Username myusername
                    Classname 
                    vB_Database 
                    doesn't seem to be, yet... you could of course delete the 'comments' row from your blog_user table, but thats not the answer, I'm sure the 'comments' row is there for a reason.

                    Comment

                    • Freddie Bingham
                      Former vBulletin Developer
                      • May 2000
                      • 14057
                      • 1.1.x

                      #11
                      One of the following tables has a comments field that is not part of vBulletin.

                      blog_subscribeuser
                      user

                      userlist

                      You can either find and remove/rename the field or you can edit the source code of blog_subscription.php and change comments to blog_user.comments

                      Comment

                      • FBJunkie
                        Member
                        • Oct 2006
                        • 71
                        • 3.8.x

                        #12
                        If removing/renaming the fields or editing the source code in the file, will this affect comments functions in other areas other than the blog?

                        Comment

                        • Marty1970
                          New Member
                          • Aug 2007
                          • 10
                          • 3.6.x

                          #13
                          Originally posted by Freddie Bingham
                          One of the following tables has a comments field that is not part of vBulletin.

                          blog_subscribeuser
                          user

                          userlist

                          You can either find and remove/rename the field or you can edit the source code of blog_subscription.php and change comments to blog_user.comments
                          Thank you for the explanation, I had assumed the source code was only looking at blog_user table row comments, but now it makes sense.

                          So a quick fix for anyone else: open blog_subscriptions.php around line 429 find :
                          PHP Code:
                          SELECT SQL_CALC_FOUND_ROWS blog_user.entriescommentslastbloglastblogidlastblogtitleblog_user.titleblog_subscribeuser.typeblog_user.ratingnumblog_user.ratingtotal
                          and replace with :
                          PHP Code:
                          SELECT SQL_CALC_FOUND_ROWS blog_user.entriesblog_user.commentslastbloglastblogidlastblogtitleblog_user.titleblog_subscribeuser.typeblog_user.ratingnumblog_user.ratingtotal
                          Hope this helps...and remember this is something you guys and girls need to remember should there be an upgrade of this file.

                          Comment

                          • Freddie Bingham
                            Former vBulletin Developer
                            • May 2000
                            • 14057
                            • 1.1.x

                            #14
                            What you need to remember, is that you have a field, installed by something other than vBulletin or the blog that conflicts with the blog. One of you send me a phpMyAdmin login and I'll tell you exactly what it is.

                            Comment

                            • Marty1970
                              New Member
                              • Aug 2007
                              • 10
                              • 3.6.x

                              #15
                              maybe this new blog addon, needs to be more ''''commentary'''#,

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎