MySQL Row Multiple Values?

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
(I kinda feel like I'm filling this section up because I'm such a noob)

Hey guys,

I was wondering... How could I create a column in a row with multiple values.
For instance, I have a column called "connected_users".
I use this row to see who a certain person is friends with.
Say "Bob" was friends with "James" & "Sally".
How could I put two values into "connected_users"?
Would I do it like: "Connected_Users: 'James', 'Sally'"
Or: "Connected_Users: James & Sally"?
Or: "Connected_Users: 'James' & 'Sally'"?

Really need help with this
Cheers.
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
So then I'd have to have a column for each user?
Like saying: Is he connected to James? No (0)
Is he connected to Anna? Yes (1)

But then I'm not sure how I'd structure it.
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,399
962
The way you structured it is incorrect. connected_users would be better off being in its own table than in a column for an existing table. Although it would help if we could see the actual database structure and what your end goal is.
 

Users who are viewing this thread

Top