PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > arrays in mysql
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
arrays in mysql

Réponse
 
LinkBack Outils de la discussion
Vieux 20/12/2007, 22h26   #1
Joe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut arrays in mysql

Is there an accepted way to store arrays in mysql(5.0).

Joe


  Réponse avec citation
Vieux 20/12/2007, 22h33   #2
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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.


  Réponse avec citation
Vieux 20/12/2007, 22h33   #3
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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
  Réponse avec citation
Vieux 20/12/2007, 22h55   #4
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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.


  Réponse avec citation
Vieux 20/12/2007, 22h59   #5
Joe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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



  Réponse avec citation
Vieux 21/12/2007, 01h37   #6
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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
  Réponse avec citation
Vieux 21/12/2007, 10h37   #7
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: arrays in mysql

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,92575 seconds with 15 queries