Re: [PHP-DB] Multiple rows for one column in a MySQL table?
You haven't to repeat the name field in the telephone numbers table. This table needs another primary key which is not "id". "id" is the foreign key that allow you to have a one to many relationship. It can be (IMHO): Client table: CLIENT_ID NAME FoneNumber table: FONE_IDFONENUMBER CLIENT_ID HTH Jayme. -Mensagem Original- De: Peter J. Krawetzky <[EMAIL PROTECTED]> Para: Cal Evans <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Enviada em: terça-feira, 27 de março de 2001 14:55 Assunto: Re: [PHP-DB] Multiple rows for one column in a MySQL table? > Even if you normalize your database design, you must still tell it who owns > the row. For example, you have a table containing the following columns: > id name > > You have another table that contains the phone numbers: > idnamephone number > > In order to connect the rows via a foreign key, you must have the > information in the first table and again in the second table. Normalization > only seperates repetative data. If you didn't normalize, your first table > would look something like this: > idnamephone number 1phone number 2phone number 3 (etc, > etc, etc). > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Multiple rows for one column in a MySQL table?
Even if you normalize your database design, you must still tell it who owns the row. For example, you have a table containing the following columns: id name You have another table that contains the phone numbers: idnamephone number In order to connect the rows via a foreign key, you must have the information in the first table and again in the second table. Normalization only seperates repetative data. If you didn't normalize, your first table would look something like this: idnamephone number 1phone number 2phone number 3 (etc, etc, etc). Peter J. Krawetzky -Original Message- From: Cal Evans <[EMAIL PROTECTED]> To: Kevin Connolly <[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Tuesday, March 27, 2001 12:26 PM Subject: RE: [PHP-DB] Multiple rows for one column in a MySQL table? >No. You need to look at normalizing your database if you have this >situation. > >Cal >http://www.calevans.com > > >-Original Message- >From: Kevin Connolly [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 27, 2001 10:48 AM >To: [EMAIL PROTECTED] >Subject: [PHP-DB] Multiple rows for one column in a MySQL table? > > >Hi, >Is it possible to have multiple rows for one column of a MySQL databes? and >if so how would I insert another row into the column in question? > >eg: > >idNamePhone Number >1Kev 123123 > >2John 234234 > 345345 > >3 Paul 789789 > >Thanks, >Kev. > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Multiple rows for one column in a MySQL table?
No. You need to look at normalizing your database if you have this situation. Cal http://www.calevans.com -Original Message- From: Kevin Connolly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 27, 2001 10:48 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Multiple rows for one column in a MySQL table? Hi, Is it possible to have multiple rows for one column of a MySQL databes? and if so how would I insert another row into the column in question? eg: idNamePhone Number 1Kev 123123 2John 234234 345345 3 Paul 789789 Thanks, Kev. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]