Post by ardragifts » Tue Apr 09, 2019 6:07 am

Hello :)
Ok, I have backuped up, imported, exported, used a full ftp back, phpadmin, etc.
Went back to months ago before I even saw this error before.
This is what I get when adding a new product.
Fatal error: Uncaught Exception: Error: Duplicate entry '776-1' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_description SET product_id = '776', language_id = '1', name = 'Egyptian Musk Incense Sticks - 13 Sticks ', description = '&lt;h3 align=&quot;center&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Egyptian Musk Incense Sticks - 13 Sticks&lt;/span&gt;&lt;/h3&gt;&lt;h3 align=&quot;center&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Bring the romance and the exotic into your life with these Egyptian&amp;nbsp;Musk incense cones.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 align=&quot;center&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;This unique incense is perfect during meditation, yoga or enlightenment exercises. Or, simply enjoy this&amp;nbsp;aromatherapy&amp;nbsp;fragrance in your&amp;nbsp;home or office - allowing the art of incense burning to fragrance the air as well as lift &amp;amp; cleanse energy in /home/ardragifts/public_html/system/library/db/mysqli.php on line 40

Any ideas on what I am doing wrong? This is a new error I never had over the years.
Thanks so much
Nancy
ardragifts.com

Active Member

Posts

Joined
Sun Mar 29, 2015 2:33 pm

Post by straightlight » Tue Apr 09, 2019 6:23 am

Not a core bug.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Tue Apr 09, 2019 8:46 am

a product description record with product_id = '776' and language_id = '1' already exists in the database.
So maybe you are not dropping/creating the database or you should use update instead of insert or insert with on duplicate key.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ardragifts » Wed Apr 10, 2019 1:17 am

Hmmm this error keeps happening with different line numbers... you would think me going thru cpanel and bringing in an old database would solve this and I could enter new products... I will keep trying old sql files til I find one that I don't get the error when I add a new product?
When adding a new product it should add to the END of my product IDs which is over 1500 … not sure why it tries to add to an existing ID.
I used excelport and exported products... then added a new products and exported products again. It IS adding it as a new product ID... grrrrr
this is frustrating.. how am I getting duplicate errors. This error happened on a working database and I didn't use excelport import months before this.
Sigh

Active Member

Posts

Joined
Sun Mar 29, 2015 2:33 pm

Post by letxobnav » Wed Apr 10, 2019 2:44 pm

Well, it keeps happening because you tell it to.
You insert sql specifically states to insert a product description record with product_id X and language_id Y.
If that combination already exists the database will not go "oh shit, I already have that one, let me get you a new one..."
It spits out an error, as it should.

So either excelport does not work properly (which I doubt) or you are editing the sheets wrong.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 280 guests