Drupal - What does vid mean

Unfortunately, vid can mean multiple things. That's not ideal, but I have not seen it causing problems (other than mild confusion now and then).

In the context of nodes, it means 'version id'. For every node in the node table, Drupal can save multiple versions in the node_revisions table. The version id is the unique identifier in the node_revisions table. (This is the vid you see in your query.)

In the context of taxonomy, vid means 'vocabulary id'. A vocabulary is a collection of related terms. Every vocabulary has a unique id.

In the context of the Views module, vid means 'view id'.

On a different note, you should not be adding nodes to the database with custom queries. The better method is to create a node object and let drupal write it to the database using node_save().


From the Drupal node object reference page, node->vid is the revision id of the current version of the node.

Node content isn't stored directly in the node table but in the node_revisions table. There's a good explanation of the table structures on this page.


vid is the revision id. In Drupal, every node can have multiple revisions. If you aren't using revisions, then the nid (node ID) will equal the vid.

Tags:

Database

Views