Announcement

Collapse
No announcement yet.

What is this database error?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is this database error?

    Database error in vBulletin 3.8.1:

    Invalid SQL:

    SELECT
    IF(votenum >= 1, votenum, 0) AS votenum,
    IF(votenum >= 1 AND votenum > 0, votetotal / votenum, 0) AS voteavg,
    post.pagetext AS preview,post.thankscache,
    thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, postusername, postuserid, thread.iconid AS threadiconid,
    thread.dateline, notes, thread.visible, sticky, votetotal, thread.attach, thread.lastpost, thread.lastposter, thread.lastpostid, thread.replycount, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views,
    thread.prefixid, thread.taglist, hiddencount, deletedcount

    , deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason

    , threadredirect.expires
    , hasannuser.displaygroupid AS hasanndisplaygid, hasannuser.usergroupid AS hasannusergid, huseyinuser.displaygroupid AS huseyindisplaygid, huseyinuser.usergroupid AS huseyinusergid, vbookie_item_id, firstpostid, attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid
    FROM thread AS thread
    LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')


    LEFT JOIN post AS post ON(post.postid = thread.firstpostid)

    LEFT JOIN threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)
    LEFT JOIN user AS hasannuser ON (thread.lastposter = hasannuser.username)
    LEFT JOIN user AS huseyinuser ON (thread.postuserid = huseyinuser.userid)LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png'))
    WHERE thread.threadid IN (0,157052,154287,148433,148840,147868,146654,144079,141724,134972,142355,142227,141870,131 697,126563,138050,138718,139408,138646,133899,135565,134321,132607,132110,128909,129051,13 0269,127519,126348,127663,128123,127227,127115,118398,123077,125546,124966,123612,119339,1 23487,123185,32715,143828,26234,987,120099) GROUP BY thread.threadid GROUP BY thread.threadid GROUP BY thread.threadid
    ORDER BY sticky DESC, lastpost DESC;

    MySQL Error : Not unique table/alias: 'attachment'
    Error Number : 1066
    Request Date : Sunday, March 8th 2009 @ 03:50:58 PM
    Error Date : Sunday, March 8th 2009 @ 03:50:58 PM
    Script : http://mysite.com/forums/forumdisplay.php?f=2
    Referrer : http://mysite.com/forums/forumdisplay.php?f=1
    IP Address : ----
    Username : AtotheC
    Classname : vB_Database
    MySQL Version : 4.1.22-standard
    DO i have to remove that referrer thread?
    I GET THIS WHEN I CLICK ONE OF THE FORUMS URL.

  • #2
    are you running any hacks or addons?

    Comment


    • #3
      I am... but that didnt happen on 3.8.0 ... and I had the hacks running..
      so it makes no sense...

      Comment


      • #4
        You have something mixed up with your modifications. These lines show up three times each in the query:
        PHP Code:
        attachment.thumbnail_filesize AS thumbsize MIN(attachment.attachmentid) AS attachmentid 
        and
        PHP Code:
        LEFT JOIN attachment as attachment ON(attachment.postid thread.firstpostid AND (attachment.extension 'jpg' OR attachment.extension 'gif' OR attachment.extension 'png')) 

        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


        • #5
          Originally posted by Lynne View Post
          You have something mixed up with your modifications. These lines show up three times each in the query:
          PHP Code:
          attachment.thumbnail_filesize AS thumbsize MIN(attachment.attachmentid) AS attachmentid 
          and
          PHP Code:
          LEFT JOIN attachment as attachment ON(attachment.postid thread.firstpostid AND (attachment.extension 'jpg' OR attachment.extension 'gif' OR attachment.extension 'png')) 
          I dont know how to fix that

          Comment


          • #6
            yup.. not sure how to fix this problem

            Comment


            • #7
              It's a plugin. Disable the extra plugins and you should be fine. It's like you installed the either the same modification three times or you installed a three modifications that each need the same information. Look through all your plugins for those added components to the query and then disable two of them.

              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


              • #8
                Originally posted by Lynne View Post
                It's a plugin. Disable the extra plugins and you should be fine. It's like you installed the either the same modification three times or you installed a three modifications that each need the same information. Look through all your plugins for those added components to the query and then disable two of them.
                didnt see this post thanks... will try and look

                Comment

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