function recipe_get_term_by_name in Recipe 6
Same name and namespace in other branches
- 7.2 modules/recipe_recipeML.module \recipe_get_term_by_name()
- 7 includes/recipe_recipeML.module \recipe_get_term_by_name()
Get the term from a specific vocab from its name. Used by bulk import routines that load the category.
Parameters
$name: The name of the term to get (String).
$vocab_id: The ID of the vocabulary that contains the term (Int).
Return value
The term data from the database. False if not found.
2 calls to recipe_get_term_by_name()
File
- ./
recipe.module, line 1841 - recipe.module - share 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));
while ($term = db_fetch_object($db_result)) {
return $term;
}
return FALSE;
}