Friend Connection SQL problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

Friend Connection SQL problem.

Post 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. :)
Post Reply