...

View Full Version : Resolved Adding a secondary contact to an account?



greens85
08-06-2010, 09:15 AM
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

Rowsdower!
08-06-2010, 01:28 PM
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?

greens85
08-06-2010, 02:31 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum