You are here

function recipe_get_term_by_name in Recipe 7

Same name and namespace in other branches
  1. 6 recipe.module \recipe_get_term_by_name()
  2. 7.2 modules/recipe_recipeML.module \recipe_get_term_by_name()

File

includes/recipe_recipeML.module, line 430
recipe_recipeML.module - Enables importing and exporting of recipeML format recipes.

Code

function recipe_get_term_by_name($name, $vocab_id) {
  $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'), $vocab_id, trim($name));
  $result = array();
  while ($term = db_fetch_object($db_result)) {
    return $term;
  }
  return FALSE;
}