You are here

function data_taxonomy_get_term_by_name_vid in Data 6

Look up a term by name and vocabulary id.

See also

taxonomy_get_term_by_name().

1 call to data_taxonomy_get_term_by_name_vid()
data_taxonomy_lookup_term in data_taxonomy/data_taxonomy.module
Look up a term by name and vid.

File

data_taxonomy/data_taxonomy.module, line 374
Hooks and API functions for Data Node module.

Code

function data_taxonomy_get_term_by_name_vid($name, $vid) {
  $db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) = LOWER('%s')", 't', 'tid'), $vid, trim($name));
  $result = array();
  while ($term = db_fetch_object($db_result)) {
    $result[] = $term;
  }
  return $result;
}