tags:

views:

943

answers:

2

This is a follow up to my previous question: http://stackoverflow.com/questions/1284476/where-does-drupal-store-node-body-content

Now, I tried adding values into node and node-revision, but still the node data is not showing. So, obviously more data is stored somewhere else. So basically, I want to know, which tables are affected when you create a new node?

+4  A: 

If you're using just straight Drupal nodes, it's all in node_revision. If you added text there and it didn't show up, you probably added it to the wrong revision - check that the vid values matches the vid for the node in the node table.

If you're using CCK to add fields to Drupal node types, the CCK data will be stored in content_type_* and content_field_* tables that are dynamically created when you add the CCK fields to the system. These again are tied to nodes via their nid and vid values.

ceejayoz
Problem is the VID. Thank you! What is the VID?
RD
`vid` is the revision ID. If you have node revisions enabled, it keeps track of past versions of the node body for historical purposes.
ceejayoz
+1  A: 

Why don't you use Drupal's node_save to programmatically create nodes? Look it up on api.drupal.org.

Node information is saved in node and node_revision. As the previous poster said, CCK stores its field data in extra tables. And additional modules store data in additional tables. So node_save is the best way usually.

If you have a very simple content type, things may not show up because of caching. If you just insert data into the db without clearing the cache, Drupal won't know it's there and may not update the page with caching turned on. Even with caching turned off, some things usually get cached, so try clearing the cache and see if that helps.

-Daniel

Adulmec Web

Adulmec

related questions