I've got a little question here:

Say I have a huge list of users inside my database and this user may or may not is a friend of someone in this list or follows someone in this list. You know things like facebook and twitter etc.

I need to store these connections somewhere in my database. So whats the best way to do it? 
My first thought was I could make a new table where every connection is stored and holds the two ids of the involved persons. This is best thing I could do I think. Pls correct me if I'm wrong.
Onother idea I had was I could make a column inside every user and store an array with friend ids or something like that. Would this be an alternative way to do this?

Hope someone can answer my questions.