0

I'm having a problem with a MYSQL Join accross three tables. I'm new to MYSQL Join functions, and can't quite figure out how to write the code. My current code is horribly innefficient and does not implement explicit joins, which I believe is much of the problem. Here it is(in php):

mysql_query("Select Airports.*, Regions.name AS RegionName, Countries.name AS CountryName, Regions.local_code AS StateCode FROM Airports, Regions, Countries WHERE Airports.ident LIKE '%".$fix."%' AND Regions.iso_region=Airports.iso_region AND Countries.code=Airports.iso_country")

I think this code shows pretty clearly which information I need from the database. Any suggestions on how to write the explicit join would be much appreciated!

2
Contributors
1
Reply
19
Views
4 Years
Discussion Span
Last Post by pixelsoul
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.