SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    customer or account name

    What do you do in the database when you have customers who are..

    [ First Name, Last Name ] - one user
    [ First Name1, Last Name1... First Name2, Last Name2 ] - 2 users husband/wife
    [ Business Name ] - name of business
    [ First Name, Last Name, Business Name ] - business name and owner/contact

    Sometimes I have customers who have a business but I also want their first and last name. Or would you just scrap that and do Account Name? Would that make searching harder for me? I want to be able to use a live search such as php with ajax, so as you type the name in different results should popup.

    This is the info I need.

    ID, SPACE #, LEASE START, ACCOUNT NAME/S, PHONE1, PHONE2, ADD1, ADD2, LAST PAID, RENT TYPE, AMOUNT PAID AT SIGN-UP, AMOUNT PER MONTH, RENEWAL DATE, MAKE, MODEL, COLOR, SIZE, TAG #, STATE

    These are the two tables I think I need to use, some of the info Ive left out from above because I could use some help on organization.

    Account
    + A_id
    + A_firstname
    + A_lastname

    (do I need to add a A_firstname2, A_lastname2, and A_business ?)

    Lease
    + L_id
    + L_a_id

    Another question my business has over 20 different locations would it be best to have a table for locations?

    Location
    + L_id
    + L_name

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Basically you want 2 tables--Accounts and Contacts. Accounts should have a PrimaryContactID field that takes, well, the primary contact ID.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •