This is a discussion on arrays in mysql within the MySQL Database forums, part of the Database Forums category; Is there an accepted way to store arrays in mysql(5.0). Joe...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
J.O. Aho wrote:
> Joe wrote: >> Is there an accepted way to store arrays in mysql(5.0). > > serialize it before you store it, then you get a "string" of the > whole array. Err, this is a relational database yes? Arrays should be stored as one-to-many relationships. |
|
|||
|
Thanks much for the prompt reply. Could you recommend a book i might buy? I
have several but they never touch the subject of arrays. Thanks again Joe "J.O. Aho" <user@example.net> wrote in message news:5t08tmF1bkv4aU1@mid.individual.net... > Joe wrote: > > Is there an accepted way to store arrays in mysql(5.0). > > serialize it before you store it, then you get a "string" of the whole array. > > -- > > //Aho |
|
|||
|
On Thu, 20 Dec 2007 22:55:47 -0000, Paul Lautman wrote:
> J.O. Aho wrote: >> Joe wrote: >>> Is there an accepted way to store arrays in mysql(5.0). >> >> serialize it before you store it, then you get a "string" of the >> whole array. > > Err, this is a relational database yes? > Arrays should be stored as one-to-many relationships. Depends a bit on whether one is representing or *storing* the array in question. If you don't care to access it within the databse, a lot of things are fair.. (: -- 91. I will not ignore the messenger that stumbles in exhausted and obviously agitated until my personal grooming or current entertainment is finished. It might actually be important. --Peter Anspach's list of things to do as an Evil Overlord |
|
|||
|
Paul Lautman wrote:
> J.O. Aho wrote: >> Joe wrote: >>> Is there an accepted way to store arrays in mysql(5.0). >> serialize it before you store it, then you get a "string" of the >> whole array. > > Err, this is a relational database yes? Yes, but we really don't know how Joe want to use his array, so if he just interested in storing the data, it's a far simpler method to store it than building a one to many relation table. > Arrays should be stored as one-to-many relationships. Absolutely if he will use the data in the database. -- //Aho |