You are here

function _taxonomy_menu_get_vid_by_tid in Taxonomy menu 6.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()
  2. 7.2 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()
  3. 7 taxonomy_menu.database.inc \_taxonomy_menu_get_vid_by_tid()

Get the vocabulary for a tid

Parameters

$tid array of tids:

Return value

$vid

File

./taxonomy_menu.database.inc, line 159
Database functions

Code

function _taxonomy_menu_get_vid_by_tid($tid) {
  if ($tid) {
    $tids = implode(',', $tid);
    $result = db_query("SELECT vid FROM {term_data} WHERE tid in (%s)", $tids);
    $vids = array();
    while ($data = db_fetch_object($result)) {
      $vids[$data->vid] = $data->vid;
    }
    return $vids;
  }
}