Simple Contact Relationship System

contactContinuing from our previous post, “Simple Contact Management System“, we are going to cover the relationship system between contact. Especially the inverse relationship.

 

The contact table actually already have the two connected users ID. So, to get the inverse relationship, when we generate the contact list, we need to search both the “user_ID” and “is_contact_of” fields. On inserting new contact relationship, we also need to check in the database, if the connection have already been made.

 

What we need is a better field names. Do you have any suggestion ? I am thinking “user_left” and “user_right”. Please share your suggestion in the comment section below.