4 clarified use case.
source | link

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in field_your_taxonomy_field, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('field_your_taxonomy_field', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

foreach($results['node'] as $result) {
  $nid = ($result->nid);
  $node = node_load($nid);
  print($node->title);
}

To be clear, this cannot load information from a view that has already been created, but it can be used instead of a view. This can be good if you don't need the view for purposes other than the fields you're trying to display right now or you need to display fields other than the way your view does.

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in field_your_taxonomy_field, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('field_your_taxonomy_field', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

foreach($results['node'] as $result) {
  $nid = ($result->nid);
  $node = node_load($nid);
  print($node->title);
}

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in field_your_taxonomy_field, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('field_your_taxonomy_field', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

foreach($results['node'] as $result) {
  $nid = ($result->nid);
  $node = node_load($nid);
  print($node->title);
}

To be clear, this cannot load information from a view that has already been created, but it can be used instead of a view. This can be good if you don't need the view for purposes other than the fields you're trying to display right now or you need to display fields other than the way your view does.

3 correct code typos.
source | link

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in country_fromfield_your_taxonomy_field, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('country_from''field_your_taxonomy_field', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

for each foreach($nid$results['node'] as $result) {
  $nid = ($result->nid);
  $node = node_load($nid); 
  print($node->title);
}

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in country_from, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('country_from', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

for each ($nid as $result) { 
  $node = node_load($nid); 
  print($node->title);
}

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in field_your_taxonomy_field, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('field_your_taxonomy_field', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

foreach($results['node'] as $result) {
  $nid = ($result->nid);
  $node = node_load($nid);
  print($node->title);
}
2 added 18 characters in body
source | link

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in country_from, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('country_from', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

for each ($nid as $result) { 
  $node = node_load($nid); 
  print($node->title);
}

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('country_from', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

for each ($nid as $result) { 
  $node = node_load($nid); 
  print($node->title);
}

It sounds like you may want to use an Entity Field Query

To do something like gather the nodes tagged with taxonomy term of tid = 2 in country_from, do something like the following:

 $query = new EntityFieldQuery;

 $result = $query
   ->entityCondition('entity_type', 'node')
   ->propertyCondition('status', 1)
   ->fieldCondition('country_from', 'tid', 2, '=')
   ->execute();

This returns a list of IDs (in this case nids) of entities that meet the conditions specified. To get info beyond the ID, you would load the entity and extract the value, with something like:

for each ($nid as $result) { 
  $node = node_load($nid); 
  print($node->title);
}
1
source | link