this is a problem of shooting for efficiency, accuracy, and practicality, and has become a problem because of my sheer lack of experience i suppose.
i have a situation like this (some of you will be familiar w/ this as i've been talking about it all week!):
i'm making a concert event scheduler where there will be performing artist info and artist management info stored in my tables. i was submitting the artist management (the contact person) and the artist info separately, and trying to tie them together with contact_id and artist_id as relational keys.
i have been using two separate forms to enter artist management (contact_info) info and artist info into separate tables. they are separated because one artist manager (one contact person) might be related by contact_id to more than one artist. after i have info in my tables, i've been using an option pull down on the new artist info submit form so that the artist can be matched w/ the appropriate contact. but, the problem is that the appropriate contact person might not already exist in my contact table, so if that is the case (which will likely be more often than not), then i need to be able to enter the Contact person's info (the artist manager) at this point also (the point at which the new artist info is being entered)
i am having difficulty finding the most efficient way to manage this part of my app-- i decided that it would perhaps be best to manage the input of both of these items, the contact (artist manager) info, and the artist info at the same time.
the reason it IS possible to separate it is that there inevitably will be more than one artist under any given artist manager. so that allowed me to have an <option> select dropdown on my artist info input page-- but then i realized that i needed to have the ability to also add a new contact (artist manager) if i needed to because the info wouldn't always be available in my pulldown menu (the <options> which i'm populating those pull-down options w/ a WHILE loop from my artist_management (contact info) table for display on the artist info input form.)
so, i'm presently trying to use a form w/ 3 parts-- artist info input, the option to enter new artist management contact info, and Finally, the pull-down menu to select an existing contact / artist manager as the contact for the new artist enrty info.
this 3-part form works except for one CRITICAL factor-- at least i can't think of a way to do it, and hence why i'm here proposing this question-- if i enter both artist and contact info NEW, there is no existing contact_id to associate with this new artist entry because the contact info is new itself, and therefore the MySQL INT NOT NULL PRIMARY KEY AUTO_INCREMENT ID for contact (and for artist_id) is being created at the same moment that the data is entered, and not before-- so my artist goes in w/out a Contact_ID. i'm not saying that this is impossible to overcome, however, w/ my novice, limited knowledge, i cant think of a way to get this 3-part harmony to work properly. it's important to have the contact_id so when the artist info is later accessed, i can also find their matching artist manager (contact person)-- part of the whole point of this application!
ideas?
thanks! by the way, i'm open for slamming-- if you think my whole approach stinks because you know of a better way to handle this type of data, then please tell me-- just don't tell me to go get a CMS because i'm trying to learn here. 😉
thanks again, and thanks for bearing w/ me as i type so many short stories!
(sxooter, i hope you're still out there this friday night / sat morn... i know you'll know the answer to this!! (and many other memeber, of course too-- i just know he was on a min ago!))
😉