Page 1 of 1

Adding multiple entries to one column in one row?

Posted: Mon Jan 15, 2007 3:02 pm
by cturner
I am wondering is it possible to add multiple entries to one column in one row? If so, how can this be done? Thanks in advance.

Posted: Mon Jan 15, 2007 3:30 pm
by Christopher
Usually you would do this with a second table, such as:

Code: Select all

parent_table
id         name
1          car
2          motorcycle

child_table
id    parent_id     name
1     1                  Audi
2     1                  Skoda
3     2                  Kawasaki
4     2                  Ducati

Posted: Mon Jan 15, 2007 3:31 pm
by Kieran Huggins
A quick and dirty hack is to serialize() an object and store the result

Posted: Mon Jan 15, 2007 3:55 pm
by John Cartwright
Kieran Huggins wrote:A quick and dirty hack is to serialize() an object and store the result
Not recommended Image. I'd go with the join.

Posted: Mon Jan 15, 2007 4:20 pm
by Christopher
Or you could save delimited data in a TEXT field and then explode() it.