|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Is there an accepted way to store arrays in mysql(5.0).
Joe |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Joe wrote:
> Is there an accepted way to store arrays in mysql(5.0). > > Joe Yes, as a one-to-many relationship between 2 tables. This is the accepted way for storing arrays in any relational database. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|