Design Question

From: Date: Mon, 17 Mar 2003 10:13:51 +0000
Subject: Design Question
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4265@lists.php.net to get a copy of this message
Hi, Not really a pear question per se, but it's the only PHP list I subscribe to, so apologies in advance. Novice design question here...I am using DB_DataObject, QuickForms and smarty, so far with no real problems and lots of success. But now I have a dilemma and wanted to abuse the better minds on this list if I may :-) I have 2 tables - agency and contact. I have a form where I can enter agency details and save them - no problem. I have a form where I can enter contact details and save them. No problem again. But an agency has one contact, and one contact works for one agency. How do I best capture that when I am either creating a new agency or a new contact? Things I am thinking about are: - have a field on the agency form to allow the user to partially enter a contact name, and have a search button next to the field so that a set of available contacts can be displayed in a select box or something. - same idea, with a 'New' button to go create a new contact (transaction management will be fun!) - commit the new agency first, then prompt for a contact (search or new). How do others deal with entering foreign key info in forms when the target of the foreign key may or may not be there? Thanks for any insights, Geoff -- Geoff Hopson Objectology Ltd. http://www.objectology.co.uk/

« previous php.pear.general (#4265) next »