The first part has been covered recently - have you checked this forum??
If you freindship model/table is something as follows:
friend_id (int,primary key)
target (int, foreign key on user_id)
requester (int, foreign_key on user_id)
status (tinyint or char stating pending/acccepted/refused)
date_accept (date when accepted)
You have a variety of sql methods, including:
1) nested select statements
2) grouping with inner joins
These can be filtered so that only those within the last week say (calculated from date_accept) are displayed under a new friends section.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080