|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
This question falls into a number of camps really but since I am using FlashForms and Coldfusion to handle the particulars I am placing it here.
I have created a database to store customer orders. When I create a new order the interface asks for the usual details, customer name, date, etc, etc. However, I am a bit stumped when it comes to adding products to an order. The reason being is that on the initial order page (when processing general order details) the order_id has not yet been generated, so there is no way to add records to an order_item table: tblorder_items(order_items_id, order_id, product_id) So my assumption is that the initial order is created on the first page and then the order items are processed on the second page, once we have a usuable order_id. However, is there a more standardised method - should I be using sessions ids or cookies to manage the process. Has anybody seen any tutorials or examples of how this is usually handled? |
|
#2
|
|||
|
|||
|
Just keep the order info in the session scope until you are ready to insert the entire thing into the database and give it an order number.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Quote:
Sounds good. Could you expand on the technical aspects of this or point me in the direction of a suitable article about how to achieve this kind of thing. Many Thanks |
|
#4
|
|||
|
|||
|
I don't know of any articles that talk specifically about it. But if you are using the session scope it's pretty straightforward. Simply keep a set of variables for the customer name, address, and other info, along with the items in their order as session variables. Once the process is finished and everything is validated, you just insert the data you've got in the session scope into the database. There's really not much to it.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Adding Items to an Order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|