ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 5th, 2005, 03:37 AM
Merlincraft Merlincraft is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 65 Merlincraft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 14 m 53 sec
Reputation Power: 4
Question Adding Items to an Order

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?

Reply With Quote
  #2  
Old April 5th, 2005, 08:16 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
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

Reply With Quote
  #3  
Old April 5th, 2005, 08:43 AM
Merlincraft Merlincraft is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 65 Merlincraft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 14 m 53 sec
Reputation Power: 4
Thumbs up

Quote:
Originally Posted by kiteless
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.


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

Reply With Quote
  #4  
Old April 5th, 2005, 08:47 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Adding Items to an Order


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT