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?
This is my query right now that is not 100% correct
# 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
Thanks in advance
There might be a bit of confusion here. Terms themselves are just free-floating entities, like free tags or categories. They can be grouped into ‘vocabularies’ — the vocabulary id is stored in the ‘vid’ column of the term_data table.
The ‘node type’ you’re pulling up in that query is the content type of the node that is tagged with the taxonomy term. That type isn’t inherent to the term itself — a given term can be used to tag many different types of content at the same time. A term can only belong to a single vocabulary, though.