Image Attachment Problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaveMorfee
    New Member
    • Jan 2005
    • 15
    • 3.0.3

    Image Attachment Problems

    When a user tries to attach am image they get the following error:

    Database error in vBulletin 3.0.3:
    Invalid SQL:
    INSERT INTO attachment
    (userid, dateline, filename, filedata, filesize, visible, filehash, posthash, thumbnail, thumbnail_dateline, thumbnail_filesize)
    VALUES
    (1, 1106836508, '01.jpg',, 62697, 1,94a3b66df8d42c89c747c3748715d0c3', 7b67f4109980024005b653667d19093', '', 0, 0)

    mysql error: Duplicate entry '65535' for key 1
    mysql error number: 1062
    Date: Thursday 27th of January 2005 02:35:08 PM
    Script: http://forum.keypublishing.co.uk/newattachment.php
    Referer: http://forum.keypublishing.co.uk/new...5b653667d19093

    Does anyone have any idea on how to fix this issue? I have also attached the full error message

    Cheers

    Dave
    Attached Files
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    That is an odd error because there is no attachmentid mentioned in this query. The first thing I recommend is that you reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server.
    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

    • DaveMorfee
      New Member
      • Jan 2005
      • 15
      • 3.0.3

      #3
      I have uploaded all the non-image files and have also restarted the webserver but the problem still persisits.

      Is there a limit on the number of attachments that can be stored in the database?

      Cheers

      Comment

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

        #4
        You need to change the attachmentid from a smallint to an int

        ALTER TABLE attachment change attachmentid attachmentid INT UNSIGNED NOT NULL

        Comment

        • DaveMorfee
          New Member
          • Jan 2005
          • 15
          • 3.0.3

          #5
          When I try and run the SQL query throught VB it says "You are not authorized to execute SQL queries" Im logged in as the webmaster, any ideas why i should get this error?

          Cheers

          Comment

          • conqsoft
            Senior Member
            • Jul 2003
            • 3803
            • 3.6.x

            #6
            Originally posted by DaveMorfee
            When I try and run the SQL query throught VB it says "You are not authorized to execute SQL queries" Im logged in as the webmaster, any ideas why i should get this error?

            Cheers
            You need to edit your config.php and give your userid permission to execute queries.
            vBulletin v3.8.0's Implementation of Google Adsense Should Be Avoided At All Costs - Do Your Own Adsense Implementation

            Comment

            • DaveMorfee
              New Member
              • Jan 2005
              • 15
              • 3.0.3

              #7
              Originally posted by conqsoft
              You need to edit your config.php and give your userid permission to execute queries.
              The config.php does not exist on the server, since this has to be removed after install. So I am at a loss how to give my accoutn permissions through the config.php file

              Regards

              Comment

              • Steve Machol
                Former Customer Support Manager
                • Jul 2000
                • 154488

                #8
                That is not true. Your vB would not run without config.php. Check your includes directory.
                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

                • DaveMorfee
                  New Member
                  • Jan 2005
                  • 15
                  • 3.0.3

                  #9
                  Ok i will take a look.

                  Also what do i need to add to the config.php to enable the webmaster account to be able to run queries

                  Cheers

                  Dave

                  Comment

                  • Steve Machol
                    Former Customer Support Manager
                    • Jul 2000
                    • 154488

                    #10
                    To run queries you first need to give yourself permission to run queries in the Admin CP. To do this, edit this section of config.php:

                    // ****** USERS WITH QUERY RUNNING PERMISSIONS ******
                    // The users specified here will be allowed to run queries from the control panel.
                    // See the above entries for more information on the format.
                    // Please note that the ability to run queries is quite powerful. You may wish
                    // to remove all user IDs from this list for security reasons.
                    $canrunqueries = 'x';


                    ...with x being your userid number.
                    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

                    • DaveMorfee
                      New Member
                      • Jan 2005
                      • 15
                      • 3.0.3

                      #11
                      Thanks for that Steve, will let you know how i get on tomorrow

                      Cheers

                      Dave

                      Comment

                      • DaveMorfee
                        New Member
                        • Jan 2005
                        • 15
                        • 3.0.3

                        #12
                        I was able to run the query and able to attach an image, however the error has returned but slightly different

                        Instead of it saying:

                        Code:
                        mysql error: Duplicate entry '65535' for key 1
                        mysql error number: 1062
                        It now says

                        Code:
                        mysql error: Duplicate entry '0' for key 1
                        mysql error number: 1062
                        Any suggestions on how to fix this is appricated.

                        Thanks

                        Comment

                        • Steve Machol
                          Former Customer Support Manager
                          • Jul 2000
                          • 154488

                          #13
                          For some reason you have two entries in the attachment table with attachmentid '0'. I think it would be safe to delete those rows. Backup your database just in case.
                          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

                          • DaveMorfee
                            New Member
                            • Jan 2005
                            • 15
                            • 3.0.3

                            #14
                            Originally posted by Steve Machol
                            For some reason you have two entries in the attachment table with attachmentid '0'. I think it would be safe to delete those rows. Backup your database just in case.
                            Steve,

                            Thanks for getting back to me, can you tell me how i would go about removeing the lines you mention as i am new to mysql

                            Cheers

                            Dave

                            Comment

                            • Steve Machol
                              Former Customer Support Manager
                              • Jul 2000
                              • 154488

                              #15
                              Browse the attachment table in phpMyAdmin. Look for any records (rows) that have an atttachmentid of '0'. Then click on the appropriate link to delete that row.
                              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...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎