Results 1 to 2 of 2
May 20, 2002, 12:32 #1
- Join Date
- Oct 2001
- Belfast, Northern Ireland
- 0 Post(s)
- 0 Thread(s)
double primary/unique, how to autoincrement one based on the other.
Sorry if the title of this post is a bit confusing as that what I am, confused.
I have the following situation
|EventID |ComponentID | Description | #---------#------------#-------------# |1 |1 | blah | |1 |2 | de | |2 |1 | blah |
Now what I want to be able to do is add a new event, I want the page to display the number of the event being added (ie the next number in the autoincrement). This has to take into the account of the ComponentID, that is (based on the table above) if I were to add a Component 1 event it would have EventId 3 but if I were to add a Component 2 event it would have EventId 2..
I'm not sure how to implement this as I'm a total Database novice.. if all else fails I'm tempted to have a table for each component but this would make adding new Components messy.
Any help greatly appreciated.
Last edited by kplex; May 20, 2002 at 12:48.