close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Duplicate entry '4' for key 'PRIMARY'

Thread began 7/12/2013 10:31 am by FrankJay | Last modified 7/12/2013 11:48 am by FrankJay | 186 views | 2 replies

FrankJay

Duplicate entry '4' for key 'PRIMARY'

I have completed the checkout wizard with partial success. I am writing the visitor and cart details to my own simplified database tables, namely: promo and promo details based on the setup of the wa_ecommerce free database.

After writing to the database, I am successfully sending an email to the user and to the site owner.

If I only have one product in my shopping cart and complete the checkout process, I have complete success.

If however, I have more than one product in the shopping cart, I get the following error when testing: Duplicate entry '4' for key 'PRIMARY' but it does email if the cart contains multiple items.

I believe this is in relation to the promo details database table that stores the. promotion details

I have tried fiddling with the bindings to the primary ID key and foreign ID key. As soon as I removed the binding from the primary ID key column, I get an error stating that this field must have an entry. By default in the wizard process this is the value that has been bound:

<?php echo ((isset($_SESSION["ssCartPromo_OrderID"]))?$_SESSION["ssCartPromo_OrderID"]:""); ?>

Is this column not supposed to be an auto incrementing field?

promo table fields:
promoid, promoname, promosurname, promoemail ….

promodetails table fields:
promodetailid, detailpromoid, promodetailcode, promodetailname ...

I do unfortunately not know how or what information to bind to the following key which is the ID of the promotion table.

When testing on my local server, (and returning to the cart page from Dreamweaver) after completing the checkout process, I noticed that the same items are still in the shopping cart. They are not being cleared from the shopping cart. How do I correct this?

Appreciate the help.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...