title: Drupal: How to know the type of a tid (term id)?
body: <p>I need to know the type of the tid in the term_data table. For example, I want to know if this tid is a type of the ed-classifieds module?</p>
  
  <p>This is my query right now that is not 100% correct</p>
  
  <pre><code># get all the parent categories for the ed classifieds
  SELECT th.tid, td.name, n.type
  FROM term_hierarchy th 
  LEFT JOIN term_data td ON th.tid = td.tid 
  LEFT JOIN term_node tn ON tn.tid = td.tid 
  LEFT JOIN node n ON n.nid = tn.nid
  WHERE th.parent = '0' 
  #AND n.type = 'ed_classified' 
  GROUP BY th.tid
  </code></pre>
  
  <p>Thanks in advance</p>