Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multiple entries in one database column

New Here ,
May 05, 2010 May 05, 2010

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.

TOPICS
Server side applications
424
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 05, 2010 May 05, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 05, 2010 May 05, 2010
LATEST

Okay, I will do it this way.  Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines