List:General Discussion« Previous MessageNext Message »
From:Andrew Date:March 19 2003 5:25pm
Subject:RE: another table to query!
View as plain text  
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:bfeist@stripped]
>Sent: 19 March 2003 16:53
>To: andrew@stripped
>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
>

Thread
another table to query!Andrew19 Mar
RE: another table to query!Andrew19 Mar
  • Re: another table to query!Bruce Feist19 Mar
    • RE: another table to query!Andrew19 Mar
      • Re: another table to query!Bruce Feist19 Mar