I want to create a friends system (something like in facebook).
I want to save relationship data in MySql, but I do not know which way is better:
To save everysingle relationship as a single entry, such as:
id | people1 | people2 1 | john | maria 2 | john | fred 3 | maria | fred
(there i declare relationships between all of these 3 peoples)
To save everyone name and list his friends:
id | people | friends 1 | fred | mary, john 2 | mary | john, fred 3 | john | fred, mary
Or maybe there is better way?