View Single Post
Old 12-16-2011, 12:59 PM  
eMonk
Confirmed User
 
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
What type of MYSQL JOIN do I need

My old query was:

Code:
$query = "SELECT city_name FROM city WHERE province_id = 9";
Now I'm using:

$city = $_GET['city'];

and just have the city name now but need to fetch all the cities in the province that $city is in.

Here are my tables:

Code:
Table: city
column: city_name = Vancouver, Victoria, Edmonton
column: province_id = 9, 9, 8

Table: province
column: id = 8, 9
column: name = Calgary, British Columbia
So if $city is in province British Columbia, what type of join to I need to fetch all cities listed in British Columbia?
eMonk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote