Black Friday Sale! Use promo code: DMXBF20 valid only for hours

DMXzone Database Connector PHP Support Product Page

Answered

Insert orders details

02 May 2017 14:35:23 Andres Gonzalez Michaca posted:
Hello I trying to solve this by my self but I can't.

I need to insert an order in the DB I have two tables, Order & OrderDetails, the second could have many items.

I have all the data in hidden text fields and the names with square brackets []; The server connect action works when the form is post.

This is what I made in server actions



But I'm Lost, hope you can help me.

Thanks

Replies

Replied 03 May 2017 06:47:38
03 May 2017 06:47:38 Teodor Kuduschiev replied:
Hello Andres,
From your post it is not really clear what exactly do you want to insert and how. Also it is not clear what exactly the issue is.
Please explain a little more detailed what exactly are you doing on your page.
Replied 03 May 2017 12:12:01
03 May 2017 12:12:01 Andres Gonzalez Michaca replied:
Hi Teodor,

It's a shopping cart and what I need to do is a multiple insert of the items in the cart into the details orders table.

Thanks
Replied 03 May 2017 12:33:24
03 May 2017 12:33:24 Teodor Kuduschiev replied:
Please send a link to your page so i can see what you have on the page already ... it is hard to tell how to do this without seeing your page.
Replied 03 May 2017 13:13:14
03 May 2017 13:13:14 Andres Gonzalez Michaca replied:
Ok,

Temporal Site:



The last step is the step 4 and the last action, by now, is clear the cart.
Replied 03 May 2017 14:15:44
03 May 2017 14:15:44 Teodor Kuduschiev replied:
So these should be inserted as separate records, in the details table?
Replied 03 May 2017 14:17:25
03 May 2017 14:17:25 Andres Gonzalez Michaca replied:
Yes, that's correct, the items in the cart.
Replied 03 May 2017 14:22:23
03 May 2017 14:22:23 Teodor Kuduschiev replied:
Well, then in server connect you need:

1. Database query, which returns the items added to the cart
2. Repeat step (repeat the query)
3. Inside the repeat add the insert step and insert in your table - using the query values ... no need of fields for the insert.

No need of [] in the names.. remove them, and re-import post vars in your action file.
Replied 03 May 2017 14:51:05
03 May 2017 14:51:05 Andres Gonzalez Michaca replied:
Great Now Works, Thank you!

Reply to this topic