I have a MySQL DB in which I store data about each user.
I would like to add a list of friends for each user. Should I create a table of friends for each user in the
You are looking for M-to-N or many-to-many join table.
Table Users:
USER_ID integer primary key,
NAME varchar
Table Friendships
USER_ID integer not null,
FRIEND_ID integer not null,
Both USER_ID and FRIEND_ID are foreign keys that reference Users table (Users.user_id).
If user 123 is friend of user 921. Add row (123, 921) to Friendships table.