views:

64

answers:

2

Hi guys, I have a simple social network project going and I would like to add a simple recommend this user profile function. A logged in user can 'recommend' a user once - its just like the 'This ansewr is helpful/not helpful' buttons here on posts in Stackoverflow. I want a simple table design to implement the exact idea - any tips?

A user can recommend any user ONLY once and likewise each profile would have a simple tally saying - this user has been recommended X times. Its just a number nothing real fancy or so...

+2  A: 

[Recommender, Recommendee, Recommendation] PK being the first two fields ?

Zed
A: 

Since it is a many-to-many relationship, you will need a separate table- unique id (auto increment), recommender (userid), recommended (userid).

Alec Smart