Two Tables Displaying using PHP
Posted: Sat Mar 22, 2003 7:50 am
So the two tables insert is now working so now the display is needed 
I have this:
however the CityID is no longer stored in the items table. It is in the city table 
So I presumably need to do a join?
Any suggestions to get me on the right track?
Andrew
I have this:
Code: Select all
// This returns all the companies from items for the selected city and business type
$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, city WHERE Category='$Category' and CityID='$CityID' ORDER BY CityID");
if (!$result) echo mysql_error();
else {
}
while ($row=mysql_fetch_row($result)) {
$IS=$rowї'0'];
$IN=$rowї'1'];
$ID=$rowї'2'];
$CpostC=$rowї'3'];
$Ca=$rowї'4'];
$City=$rowї'5'];
$Ctele=$rowї'6'];
$II=$rowї'7'];
$Cf=$rowї'8'];
$Ce=$rowї'9'];
$Caddress=$rowї'10'];
$Ctown=$rowї'11'];
$Cw=$rowї'12'];So I presumably need to do a join?
Any suggestions to get me on the right track?
Andrew