Design Issues - How to work out 1:M relationships when designing forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fjm
    Contributor
    • May 2007
    • 348

    #1

    Design Issues - How to work out 1:M relationships when designing forms

    I am having a bit of a problem getting my head around how to handle a design issue and hope that someone can offer some assistance.

    I am making a front end to a mysql database in PHP. I am at the point where I am coding the forms that will take the user's input for the customer data. In a nutshell, I want to give the user the ability to save multiple contact persons, emails and phone numbers.

    OK. There can be many customers on this system and each customer can
    have many employees. Each employee can have multiple contact numbers,
    i.e. home phone and email addys. These are all 1:M relationships. I
    can fix this problem by only giving the user a predetermined number
    employees and phones, etc but it's not correct and besides, I know
    there is a much better way to handle this issue. If they want to enter
    15 employees and 50 contact numbers for each employee, they should be
    able to do that.

    I'm thinking that it should function something like the Google Mail
    add attachments where when you need more than 5 attachments, you can
    click an input button and another textbox dynamically appears. Maybe there is even a better way than that.

    The next issue I have is that I need to give the user the ability to
    insert, update and delete data accordingly but exactly how to do that
    is my dilemma. Should this be done on different forms or on a single
    form? I’m having a hard time picturing how this needs to go together
    because of the 1:M relationships involved.

    Can anyone provide any insight on how to handle this?

    Thanks!
    Frank
Working...