2
votes

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. Basically, I want to know which tables are affected when you create a new node.

2
Drupal does a lot of caching of intermediate rendering results to improve performance - by changing the database directly, you're likely bypassing logic that invalidates the cache and seeing a page that's technically out of date. Go to Site Configuration, Performance and press Clear Cached Data to test this.Bevan

2 Answers

6
votes

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.

2
votes

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.