Hello, I have some problem with inserting external data into drupal database.
The external data is from another db.

The following is my steps:
1. Create one content type and add fields for this content type
2. I have found that if i create one instance of such content type, then nine tables would be changed in drupal db.

So must i have to update those nine tables when i insert data for each content type i make?

Thanks in advance.

Comments

matkeane’s picture

Hi,

If you choose to do everything manually - i.e. import directly into the database using SQL commands - then yes, you'll need to map your incoming data to the appropriate Drupal tables. You can probably imagine how much fun that is!

An alternative, assuming you can connect to your external data somehow, is to write a custom module to create a new node object for each row of your data, and then run it through node_save so that Drupal deals with saving things out to the correct tables.

There are some existing modules out there for importing data - the node import (http://drupal.org/project/node_import) module has worked for me in the past, as has http://drupal.org/project/taxonomy_xml. You might also want to take a look at the Table Wizard module (http://drupal.org/project/tw) for more complex imports.

liaolliso’s picture

Yes, i use node_import module and can import those records well.
Really nice. Thanks very much. I can continue now.