Jump to content

Select an Item that has a Composite Key?


doubledee

Recommended Posts

I am unsure of how to select something made up of a composite key.

 

Allow me describe the entity...

 

Event

ShowID (pk)

VenueID (pk)

StartDateTime (pk)

 

 

My Checkout process will have an HTML Table displaying maybe 3-4 different Events like this...

 

=========================
Register in 3 Easy Steps...

Step #1: Select a Date and Attendees

Event		Ticket			(Update)	Choose
Name		Cost	Attendees	Total		One
Flower Show	$20	___		$0		<<Buy a Ticket>>
Mankato, MN
Sept 24, 2011

Flower Show	$20	_3_		$60		<<Buy a Ticket>>
Willmar, MN
Oct 1, 2011

Banjo Jamboree	$50	___		$0		<<Buy a Ticket>>
Brainerd, MN
Oct 8, 2011

=========================

 

When a User clicks on a particular "Buy a Ticket" button, how do I capture the 3 Composite Key Values I need so I can insert them into my Order table?

 

Maybe a better question to ask, is HOW/WHERE would I store the 3 Composite Key Values so that when a User clicks on a given "Buy a Ticket" button, that I have the values I need to build my Order record??

 

Normally with just one value (e.g. Drop-Down List), when someone selects a value, there is a corresponding code that you'd use.  For example "Extra Large" in a Drop-Down List equals "3".

 

Hope I'm making sense?!

 

Thanks,

 

 

 

Debbie

 

 

Link to comment
https://forums.phpfreaks.com/topic/249661-select-an-item-that-has-a-composite-key/
Share on other sites

You would pass the values the same as you always would - either as form fields passed via POST or GET or you could simply append the values to a URL. Since you are using buttons, make each button the submit button for a form. Then you can store the three values as hidden fields for each form.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.