Welcome Guest, Not a member yet? Register   Sign In
Table fields for "friends" ... more of a MySQL Question
#1

[eluser]jonnyjon[/eluser]
Hi guys,
I have a friends table but I'm debated how to lay it out and use it.

Currently. this is how it looks:

=======================================================
| id | user_id | user_id_2 | is_approved | is_blocked |
=======================================================

So if user 1 and 2 are friends it would require 2 records for that friendship, one record to say user 1 is friends with 2 and another to say user 2 is friends with 1.

==============================
| 1 | 1 | 2 | true | false |
| 2 | 2 | 1 | true | false |
==============================

There must be a more efficient way to do this?


Messages In This Thread
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-04-2008, 10:26 PM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 01:24 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 01:29 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 01:32 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 01:41 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 02:07 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 02:21 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 03:04 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 08:09 AM
Table fields for "friends" ... more of a MySQL Question - by El Forum - 03-05-2008, 09:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB