id, name
and another table called county_boundaries that looks like
id, county_id, lat, lon, extra_info
There are 4 records in county info, and I need to select all from the second table where county_id is equal to any of the county_info ids. How would I do this?
EDIT: OK, I got this:
Code: Select all
SELECT * FROM `county_boundaries`, `county_info` WHERE county_info.id = county_boundaries.county_idCode: Select all
Array
(
[Tehema] => Array
(
[0] => Array
(
[id] => 8
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
[1] => Array
(
[id] => 8
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
[2] => Array
(
[id] => 8
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
)
[Butte] => Array
(
[0] => Array
(
[id] => 10
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
[1] => Array
(
[id] => 10
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
[2] => Array
(
[id] => 10
[lat] => "-0.122220241240514E+03"
[lon] => "0.401418265246914E+02"
)
)