944,110 Members | Top Members by Rank

Ad:
Aug 16th, 2007
0

DBDesign - Private/Public data

Expand Post »
Hi everybody!

I am Daniel and I am developing a Alumini Database right now using MySQL and Ruby On Rails. First of all, I must say this is an amazing forum. I really enjoy reading the posts. I hope you will be able to help me.

I have the following problem in my design. Every alumni will have certain properties, such as Adress, Study, Birthdate, Employers . . . you get the picture. Now the Alumi should be able to select which data are publicly viewable and which only by other alumni.

There is a sulution in place, which I inherited, but I would like to change it. The old solution is to have one large Table where there is an extra binary column for every data column. -> Adress, Adress_Public

Well this is not optimal. Now I thought of having a properties table and a properties_public table in which I could save the memberID and the property that is public.
But I do not really know how to implement without havong to loop over all the findings.

If I would, with the above scheme, select all properties I would get
1, Adress 
1, Birthdate
1, Job
And then I need to loop over this to get the actual information. That is not really effective either.

Do you maybe have an idea?

Thank you very much!

All the best

Daniel
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danielgoehl is offline Offline
3 posts
since Aug 2007
Aug 16th, 2007
0

Re: DBDesign - Private/Public data

Hi,

We lately started adding all the allowed information to be view in 1 field for each user as a concatunated strings seperated by a special char like ";" or "/" then we check parts of it using string functions like mid, IN, find, search or substr depending on language being used the table usually looks like:
1 Name;Address;Phone
2 Name;Phone

I hope this helped.
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Aug 18th, 2007
0

Re: DBDesign - Private/Public data

Hi thank you very much for this tip!

This looks quiet good. As far as I understand, I still need to make two querys to get only the public data as a result. I first would select the public columnames and the build a query with them to receive the actual data.

Isn't there a possibility to put the whole logic of this into the DB so that a SELECT only gives me publicly viewable data?

I am busting my head about this, but I can't find a solution.

Thanks

Daniel
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danielgoehl is offline Offline
3 posts
since Aug 2007
Aug 18th, 2007
0

Re: DBDesign - Private/Public data

Hi,
What are u using as an interface VB6, .net, access ... ? depending on that I may be able to provide you with the solution.
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Aug 18th, 2007
0

Re: DBDesign - Private/Public data

Hi!

I am using Ruby On Rails together with MySQL. But I know some VB. Some pseudo code would really help!

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danielgoehl is offline Offline
3 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: Recomendations for a book on database design
Next Thread in Database Design Forum Timeline: help me on blog Dtabase





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC