Skip to main content
Participant
May 5, 2010
Question

Multiple entries in one database column

  • May 5, 2010
  • 1 reply
  • 423 views

Hello.

I am a bit of a php/mysql newbie.  I'm trying to figure out how to select multiple data entries from one database column.

For example, I have a column in one table called name_id.  I want to assign multiple names to a specific entry in this table.  Like, "1,4,12,18", for example.  Each of these numbers are the primary keys for my name table.  So, I'm trying to assign 4 people to one set of data in this example.

I have seen this done before, I just don't know how to select this data once it is in there.  I think it may have something to do with arrays, but I'm not sure.

I hope this makes sense, any help would be much appreciated.

This topic has been closed for replies.

1 reply

Participating Frequently
May 5, 2010

That's a poor design plan as it violates the basic rules of normalization and will cause  problems in the end. Just create another table to link to and store the one value in each row. If you need more details, then tell us exactly what you are trying to do.

Participant
May 5, 2010

Okay, I will do it this way.  Thanks.