Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Jul 2007
    Posts
    20
    Plugin Contributions
    0

    Default 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    When I tried to update my database I received the error:

    Code:
    1062 Duplicate entry '0' for key 1
    in:
    [INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment) SELECT project_version_key, project_version_major, project_version_minor, project_version_patch1 as project_version_patch, project_version_date_applied, project_version_comment FROM project_version;]
    Any ideas?

  2. #2
    Join Date
    Jan 2004
    Posts
    58,265
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    What version of PHP?
    What version of MySQL?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    PHP version: 4.4.4
    MySQL version: 4.1.22-standard

  4. #4
    Join Date
    Jan 2004
    Posts
    58,265
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    If you use phpMyAdmin to look at that table, what indexes are associated with it?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jul 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    I went to phpMyAdmin and noticed this:

    Code:
    Create new database: No Privileges
    Perhaps this has something to do with it? Then looked up indexes for project_version_history and found:
    Code:
             Indexes:         
    Keyname             Type             Cardinality             Action             Field
    PRIMARY             PRIMARY          15                     Edit / Drop         project_version_id

  6. #6
    Join Date
    Jan 2004
    Posts
    58,265
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    It appears you've lost your auto_increment setting for the project_version_id field.

    To reinstate it, you can add it via phpMyAdmin's table editor, or you can run this SQL statement:
    Code:
    ALTER TABLE project_version_history CHANGE COLUMN project_version_id  project_version_id tinyint(3) NOT NULL auto_increment;
    The more important question is ... *why* did it lose that setting?
    First, confirm that setting the auto_increment again solves it.

    Then consider resetting all your auto_increment settings using the /zc_install/sql/db_rebuilt_autoincrement.sql script, running it via phpMyAdmin's Import tab.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jul 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    I ran the SQL statement and received the message:

    Code:
    Your SQL query has been executed successfully (Query took 0.1879 sec)
         SQL query:        ALTER  TABLE project_version_history CHANGE  COLUMN project_version_id project_version_id tinyint( 3  )  NOT  NULL  AUTO_INCREMENT
    I then retried to update the database from 1.3.6-->1.3.8a. I received this message:

    Code:
    in:
    [select admin_id, admin_name, admin_pass from admin where admin_name = 'webmaster']
    I clicked 'back' to reenter the admin info and retried. I received the same message again.

  8. #8
    Join Date
    Jan 2004
    Posts
    58,265
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    Quote Originally Posted by Ellume View Post
    Code:
    in:
    [select admin_id, admin_name, admin_pass from admin where admin_name = 'webmaster']
    I gather there was nothing more to the error message than that? Normally something else appears before the "in:" part.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jul 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    Just an empty line where there normally is something.

    One thing that might play a part is because of server space issues I wasn't able to create a separate folder like recommended (like the "/store_new") and do the swapping name. I simply overwrote the new version over the old. I do have backups of everything however so I can revert back if needed. It does seem this might leave unneeded files floating around, as such I'm considering to delete it and reupload the newversion again to keep things cleaner.

  10. #10
    Join Date
    Jan 2004
    Posts
    58,265
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a

    Clean is always good.
    However, I'd be surprised if that scenario were caused by any normal old files.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. SQL Error : 1062 Duplicate entry '0' for key 1
    By Wazoo in forum General Questions
    Replies: 3
    Last Post: 3 May 2007, 02:50 PM
  2. Replies: 1
    Last Post: 22 Mar 2007, 05:27 PM
  3. Replies: 2
    Last Post: 20 Oct 2006, 09:49 PM
  4. Error 1062 Duplicate Entry
    By reddog73 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 8 Sep 2006, 06:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •