Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2010
    Location
    Manchester, UK
    Posts
    27
    Plugin Contributions
    0

    Default PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    I've started receiving the error below when I try to add new products to my site. I can no longer add any new products as I get an error telling me to refresh the page and try again. When I checked the logs on my site I get a PHP Fatal Error as below. Is there something I can do to fix this? I guess this is related to my products table in mysql?

    Code:
    PHP Fatal error:  1062: Duplicate entry '2147483647' for key 1 :: insert into zen_products (products_quantity, products_type, products_model, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) values ('0', '1', 'test', '0', null, '0', '1', '0', '1', '0', '1', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0', '0', '', now(), '36') in /home/mystore/public_html/store/includes/classes/db/mysql/query_factory.php on line 120

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    Do you truly have more than 2,147,483,647 products in your store?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    Jun 2010
    Location
    Manchester, UK
    Posts
    27
    Plugin Contributions
    0

    Default Re: PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    Thanks for replying DrByte, I have around 3500 products on my site so I dont know what's happened. I was bulk importing and updating products today using the apsona add on by pasting data from a spreadsheet as i have done before many times then suddenly this happened.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    Ya, your importing activities have caused all your product numbers to keep increasing ... so much so that it's blown out the limit of 2.1 billion allowed.
    It would seem also then that if you're always changing your product numbers, that search engines aren't going to have consistency in finding your products let alone directing customers to them correctly.

    Strictly speaking, you need to wipe all your products out completely, then do a database reset, and then reload them. And then make sure any importing you do PRESERVES existing product numbers, instead of assigning new ones all the time. Until you determine how to make it preserve product numbers, there's not much point doing any cleanup.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    Jun 2010
    Location
    Manchester, UK
    Posts
    27
    Plugin Contributions
    0

    Default Re: PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    So because I am fairly new to Zencart and still learning can you explain how this happened, is it something I have done incorrectly or could it be the add on I have been using? Most of the imports were existing products with price changes, and the apsona addon searches for the model number to do the updates.

    I have so many products to update it probably would be best to wipe the database and reimport them in one go. I have no idea how wipe all my products and do a database reset, some guidance on the steps to do this would be very much appreciated.

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: PHP Fatal error 1062: Duplicate entry '2147483647' for key 1

    I also found this to be happening with Apsona uploading... Perhaps it's something you need to take up with them.
    20 years a Zencart User

 

 

Similar Threads

  1. Replies: 3
    Last Post: 21 Jan 2016, 10:35 PM
  2. v151 PHP Fatal error:1062:Duplicate entry '1-1' for key 'PRIMARY'
    By Dopefish in forum General Questions
    Replies: 14
    Last Post: 19 Oct 2012, 02:58 AM
  3. Replies: 4
    Last Post: 16 Jul 2012, 10:36 PM
  4. 1062 Duplicate entry '2147483647' for key 1
    By dmm2020 in forum Managing Customers and Orders
    Replies: 10
    Last Post: 13 Jul 2009, 08:17 PM
  5. 1062 Duplicate entry '2147483647' for key 1
    By bblue03 in forum General Questions
    Replies: 2
    Last Post: 9 May 2008, 07:38 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR