Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Adding a secondary contact to an account?

    Hi All,

    I have a situation where a user can login to a secure area of my site, the login details are provided by me (it's not a sign up thing).

    What I'm trying to do is once they are logged in, allow them to add an additional contact themselves. However I'm having some problems working out how to do this in the database side of things.

    I need the second contact to be associated with the currently logged in account, but also need them to be deleted separately. e.g. the main contact may wish to remove the secondary contact (if they leave the company etc.)

    I was thinking something along the lines of a new table for the secondary contacts, then using a join by a second id... maybe 'groupid' in order to do this, but as I say I am struggling.

    Can anyone advise on this.

    Many thanks,

    Greens85
    Last edited by greens85; 08-06-2010 at 02:32 PM.

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    You could just add a new column to the existing table called "contact2" or similar. Then, default it to whatever you like and allow users to overwrite that default by adding their own second contact address. Then, if they want to delete their added contact later, allow them to do so by resetting that field to the default. And then in contact pages only show a second contact where the value is not equal to that default.

    Is there any reason that you could not just do that?
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Rowsdower! View Post
    You could just add a new column to the existing table called "contact2" or similar. Then, default it to whatever you like and allow users to overwrite that default by adding their own second contact address. Then, if they want to delete their added contact later, allow them to do so by resetting that field to the default. And then in contact pages only show a second contact where the value is not equal to that default.

    Is there any reason that you could not just do that?
    Hi Rowsdower,

    Thanks for your reply.

    I've got this sorted now, I went down my route.. mainly because as I was trying it and testing I completely forgot I had posted here for help! Once it was complete I realized I has posted here! lol

    Many thanks.


  •  

    Posting Permissions

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