Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have developing social networking website, and in this website i am giving "friend suggestion", "friend list", "mutual friends list

(between login user and another user)". all this staff i am doing very well in SQL. for that i have following table(s) in MS SQL 2008.
1) CountryMaster (CountryID (Pk), CountryName )
2) StateMaster (StateID (Pk), StateName, CountryID (Fk->CountryMaster.CountryID) )
3) CityMaster (CityID (Pk), CityName, StateID (Fk->StateMaster.StateID) )
4) UserMaster (UserID (Pk), UserName, FName, LName, Email, BirthDate, CityID (Fk->CityMaster.CityID) )
5) UserFriends (TableID (Pk), UserID (Fk->UserMaster.UserID), FriendID (Fk->UserMaster.UserID), Status (eg. 1.Accepted,2.Pending)

)

now in redia i have created i hashes for UserMst like
hset "UserMst:id hase"
example = hset UserMst:1 [UserID:1, UserName:ryan, FName:ryan, LName:Briones, Email:ryan@somedomain.com, BirthDate:1984-05-31, CityID:548]

one set i have created for logged in user's fiend list.
sadd "FriendList:id array
example = sadd "FriendList:1 [548,4785,6589,214587]"

one another set i have created for loggedin users.
sadd "LogginUsers" 1

now i want to "friend suggestion", which give me user list which in not in my contact list but it is exists in my friend's contact list,

and order should be maximum mutual count show first, then citywise (login user's city)

i have read documents, posts, blogs but i can not understand how i do this... i think i have to think it out of box, but how i don't

know. if someone guide me, i will definitely reach to solution. please help me.

thanks
Posted
Comments
bbirajdar 28-Jul-12 6:12am    
What are these words --redis, redia,fiend?? could not find it in the dictionary
manish_sapkal 30-Jul-12 1:18am    
sorry for my bad English and spelling mistakes.
bbirajdar 29-Jul-12 4:34am    
Questions with clear explanation get answers within an hour. You must use additional 10% of the time to use full forms of the words to get the answers. Otherwise its a waste of time of yours and ours
Sebastian T Xavier 30-Jul-12 0:51am    
Not a good question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900