RE: [PHP] Newbie - MySQL Question - Finding Unique Names in Column

From: Date: Tue, 27 Mar 2001 23:09:29 +0000
Subject: RE: [PHP] Newbie - MySQL Question - Finding Unique Names in Column
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45769@lists.php.net to get a copy of this message
> -----Original Message----- > From: Rami Krayem [mailto:rami@totalpisser.com] > Sent: Tuesday, March 27, 2001 11:49 AM > To: php-general@lists.php.net > Subject: [PHP] Newbie - MySQL Question - Finding Unique Names in Column > > > I have a listing of photos in a table as follows (not actual > column names): > > Image Name, Image Width, Image Height, Band Name, Venue, City, State, Date > > > I would like to have a list of the different bands with photos in the > archive. There may be 120 photos of any one band, but I would like to > select the name of the band only one time and have it printed in the list. > Is there a MySQL function that would do this, or should I just put the > different bands into a separate table? > > Any help would be appreciated. Split the table up into 3 tables, one for bands, one for pictures, and one for the venue. table_bands fields--- band_id (pk) band_name table_pictures fields--- picture_id (pk) band_id (fk) venue_id (fk) picture_name picture_width picture_height table_venue fields--- venue_id (pk) venue_name venue_city venue_state venue_date Read this and you can see how I came up with the tables. Its covers the 4 Forms of Normalization. http://www.newbienetwork.net/sections.php?op=viewarticle&artid=17

« previous php.general (#45769) next »