S3NTIN3L;10975042 wrote:does anyone recommend have comma separted values in one row instead.
Definitely not - this violates normalization techniques and simply generates more work for you and/or the server.
S3NTIN3L;10975058 wrote:Are you saying add columns each favourite added?
Definitely not. What dagon is suggesting is a simple two-column table structure, e.g. (user1, user2). Both columns would be foreign keys back to your users table to show the relationship "user1 ---> [added favorite] ---> user2".
Thus, if you wanted to find the names of all users that I have added as a favorite, you'd do something like:
SELECT u.name
FROM favorites f
INNER JOIN users u ON u.user_id = f.user2
WHERE f.user1 = 123
(where my user_id value is 123).