Announcement

Collapse
No announcement yet.

Invalid SQL: INSERT INTO attachment

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

  • Invalid SQL: INSERT INTO attachment

    hi i just backed up my forum and i think after i backed it up is when i started having this problem.

    my problem is that when i try to post an attachment on my forum i get this error:

    Database error in vBulletin 2.3.0:
    Invalid SQL: INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,hash) VALUES (NULL,2,1062721849,'footer.gif','1','d2395d2080c0c04f40b1278ff26f1b79')
    mysql error: Duplicate entry '65535' for key 1
    mysql error number: 1062
    Date: Thursday 04th of September 2003 05:30:49 PM
    Script: http://www.puregraffiti.com/forum/up...d/newreply.php
    Referer: http://puregraffiti.com/forum/upload...&threadid=3604


    can someone please help? is there a simple fix?

    thanks

  • #2
    help

    Comment


    • #3
      Please wait at least 12 hours before bumping your thread.

      It looks like your attachment table has reached it's 65535 limit. You''ll need to change the type and length of your attachmentid filed in the attachment table. See this thread for instructions:

      http://www.vbulletin.com/forum/showthread.php?t=52198
      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


      • #4
        how do i do this? can i do this in putty? or if myphpadmin, where do i click to do this?

        """"OK.. figured out and fixed.

        Synopsis:

        Attachments were only designed in VB to use a Small Integer of 5 as the ID.

        Well on any large site, that unique ID number limit of 65534 is going to run out and your users will not be able to use attachments.

        The fix:

        What Ed eluded to above as well as one more change.

        1. Change the INT value in table Attachement and field attachmentid.
        (This can be done with a query or PhpMyAdmin.)

        Change SMALLINT to INT and change Length from 5 to 10.

        ALTER TABLE `forum`.`post` CHANGE `attachmentid` `attachmentid` INT(10) UNSIGNED DEFAULT '0' NOT NULL



        2. Change the INT value in table Post and field attachmentid.

        Change SMALLINT to INT and change Length from 5 to 10.

        ALTER TABLE `forum`.`post` CHANGE `attachmentid` `attachmentid` INT(10) UNSIGNED DEFAULT '0' NOT NULL"""""

        Comment


        • #5
          nm i got it but one more question, will i have to do this again if the forum gets more attachments in the future?

          thanks

          Comment


          • #6
            No, things should be fine now.
            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...
            X