Jump to content

Recommended Posts

My old query was:

 

$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:

 

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?

Link to comment
https://forums.phpfreaks.com/topic/253335-what-type-of-join-do-i-need/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.