close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

There is an error in hou sql SYNTAX - ECART

Thread began 9/20/2022 10:52 am by QuiruNet | Last modified 9/22/2022 9:05 am by Ray Borduin | 400 views | 14 replies |

QuiruNet

There is an error in hou sql SYNTAX - ECART

I am trying to store de sumary and the details of the order...but e get the same message...Can you help me?

Attached Files
cesta-final.php
queryobj.php
Sign in to reply to this post

Ray BorduinWebAssist

If you update this line in your queryobj.php file:
$this->Debug = false;

to:
$this->Debug = true;

It should give you a better error message.

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

this is the error that show

INSERT INTO orders (`n_pedido`, `total_pedido`, `clienteID`, `portes`, `statusID`, `observaciones`) VALUES ('PE-200922-5', 0, 5, 0, 1, DEFAULT)

Duplicate entry 'PE-200922-5' for key 'n_pedido'

Sign in to reply to this post

Ray BorduinWebAssist

n_pedido is set as a unique column in your database but you are attempting to insert a value that already exists in the table.

I don't even see an <input> field named "numero" which you are using to do the update. Your trigger for the database insert is "before page load" which runs before any form is posted, so something is wrong with that logic.

Sign in to reply to this post
Did this help? Tips are appreciated...

Ray BorduinWebAssist

Please attach a current version of the page so I can see what might be wrong.

The error means you are trying to insert a repeated order. Your order id "n_pedido" has to be unique in the database.

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

Now it is working, the ploblem was the number id, it was the same. The summary store the data, but the deails doesnt safe into the data base

Sign in to reply to this post

Ray BorduinWebAssist

Please attach the current version of the page and I can see if I can spot the problem or help you debug it.

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

the Gran Total, i can save it in the store summary and i use: <?php echo $eCart1->GrandTotal(); ?>

Attached Files
cesta-final.php
Sign in to reply to this post

Ray BorduinWebAssist

This line should be on the top of the page... but after the ecart include.

php:
<?php

$eCart1
->GetContent();
?>


Try moving it to line 14

Sign in to reply to this post
Did this help? Tips are appreciated...

QuiruNet

this is the error that i get, when it has to safe two different products....in the store details:

INSERT INTO orderdetails (`n_pedido`, `nombre_producto`, `precio_producto`, `unidades`, `peso`, `totalPrecio`, `sku`, `prodID`, `clienteID`) VALUES ('PE-200922214500-5', 'Filetes de sardina', 5, 11, 120, 75, '0002', 2, 5)

Duplicate entry 'PE-200922214500-5' for key 'n_pedido'

Attached Files
cesta-final.php
Sign in to reply to this post
loading

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...