Page 1 of 1

Friend Connection SQL problem.

Posted: Fri Jan 28, 2005 4:27 am
by angelena
Hi,

Im doing on something like a friend web system,something like Friendster.
I would like to display the total friends a user have based on their friend level.

I differentiate a user's friends by 2 level.
Let say A <=> B
B <=> C
C <=> D

So, B will be A's Friends
C is A's !st level friend.
D is A's 2nd level friend.

I have a db for Friend Connection with two main field i.e. Start and End
Start and End contains the id of the two people connected.

I able to do the sql on counting Friends for A,but have no idea on how shud i count the rows for 1st & 2nd level friends.

Can anyone show me some guideline?

Thanks in advanced. :)