function recipe_unit_name in Recipe 6
Same name and namespace in other branches
- 5 recipe.module \recipe_unit_name()
Converts a recipe unit ID to it's name
3 calls to recipe_unit_name()
File
- ./
recipe.module, line 1148 - recipe.module - share recipes
Code
function recipe_unit_name($unit_id) {
static $unit_names;
if (!$unit_names) {
$rs = db_query("SELECT id, name FROM {recipe_unit}");
while ($unit = db_fetch_object($rs)) {
$unit_names[$unit->id] = $unit->name;
}
}
return $unit_names[$unit_id];
}