Hi, this is irphan . i am creating social networking site and need a friend system like facebook] . i don't have any idea aout this .can anyone help me?kindly tell me how many tables would require to manage friend system and how can i manage them. i am working in php.this help w'll be highly appreciated.thanks

Recommended Answers

All 4 Replies

What i did for one of my previous sites was to have just one table named "friends" and then have the following columns:

id | friendTo | friendFrom | status

So when a user send a friend request your PHP files inserts the following row to your table such as:

1 | Daniel | Bluecharge | Pending...

Then on the users friends page, any requests will be fetched from the database in a while loop and then have accept or decline

The accept will update the status from Pending... to Completed...

Then the users accepted friends will be fetched with the status of "Completed..."


I know what i mean as i have did this but if you dont understand im sorry, i tried my best to explain but had difficulty in doing so.

Daniel

nice post thanks myfrend.

Hope it helped you.

Thanks Daniel for reply i had done this work. i have friends table but i want whole description .like when anyone reject the friend request what i w'll have to do.so please tell me something more ....so that i could complete this module.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.