Redwood Logistics
5.0
SELECT
t.term_id,
t.name,
t.slug,
tt.parent,
tt.count,
tt.taxonomy
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tr.object_id = 7744
AND tt.taxonomy = 'location'
Array
(
[0] => stdClass Object
(
[term_id] => 194
[name] => United States
[slug] => united-states
[parent] => 162
[count] => 3656
[taxonomy] => location
)
[1] => stdClass Object
(
[term_id] => 5818
[name] => Mexico
[slug] => mexico
[parent] => 0
[count] => 68
[taxonomy] => location
)
[2] => stdClass Object
(
[term_id] => 5819
[name] => Mexico City
[slug] => mexico-city
[parent] => 5818
[count] => 25
[taxonomy] => location
)
[3] => stdClass Object
(
[term_id] => 5820
[name] => Mexico City
[slug] => mexico-city
[parent] => 5819
[count] => 25
[taxonomy] => location
)
[4] => stdClass Object
(
[term_id] => 5880
[name] => Illinois
[slug] => illinois
[parent] => 194
[count] => 171
[taxonomy] => location
)
[5] => stdClass Object
(
[term_id] => 5883
[name] => Chicago
[slug] => chicago
[parent] => 5880
[count] => 75
[taxonomy] => location
)
[6] => stdClass Object
(
[term_id] => 5926
[name] => Nuevo León
[slug] => nuevo-leon
[parent] => 5818
[count] => 28
[taxonomy] => location
)
[7] => stdClass Object
(
[term_id] => 5933
[name] => Monterrey
[slug] => monterrey
[parent] => 5926
[count] => 22
[taxonomy] => location
)
[8] => stdClass Object
(
[term_id] => 6622
[name] => Querétaro
[slug] => queretaro
[parent] => 5818
[count] => 8
[taxonomy] => location
)
[9] => stdClass Object
(
[term_id] => 6623
[name] => Querétaro
[slug] => queretaro
[parent] => 6622
[count] => 7
[taxonomy] => location
)
)
Array
(
[0] => Mexico City
[1] =>

Chicago
[2] => Monterrey
[3] => Querétaro
)
4 Locations Mexico City
ChicagoMonterreyQuerétaro