I have done this and have now started to populate the items_city table with the appropriate records what I now need to do is show the records using the city items_table. At the moment the records are dipslyed when a city is selected bu the cityID is from the items table. Lie this:
$result=mysql_query("SELECT items.ItemSKU, items.ItemName, items.ItemDescription, items.PostCode, items.Category, items.CityID, items.CTelephone, items.ItemID, items.Cfax, items.Cemail, items.Caddress, items.CTown, items.Cwww FROM items WHERE Category='$Category' and CityID='$CityID' ORDER BY CityID"); Presumably I need to do a JOIN ? Andrew >-----Original Message----- >From: Bruce Feist [mailto:[EMAIL PROTECTED] >Sent: 19 March 2003 16:53 >To: [EMAIL PROTECTED] >Subject: Re: another table to query! > > >Andrew wrote: > >>I have just discovered through luck that I need to have the same record in >>(table items) accessable if it is listed as being in more than one city (table >>city). Obviously I don't want to create new records for the same >item so it can >>be displayed if it's in different cities. Is the best way to do this >to create >>a new table and call it reference_city with items.ItemID and >city.CityID as the >>columns? >> >> >Yes, although I'd probably call it item_city to make it more obvious >what it is. > >Bruce Feist > > > > >--- >Incoming mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003 > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php