Well...
First you have to have your data in something like a CSV file...
Then you need a script which is going to iterate over each line of the CSV file, see if it can find an existing node to add data to, or else create a new node.
$article_nid = get_nid('title', $article_name, 'article');
if ($article_nid) {
$article_node = node_load($article_nid);
} else {
$article_node = new StdClass();
}
$article_node->type = 'article';
$article_node->name = 'Article';
$article_node->format = 3;
$article_node->status = 1;
$article_node->promote = 0;
$article_node->sticky = 0;
$log = 'Imported by import-issue ' . date('g:i:s a');
...
// cck fields handled a little differently
$article_node->field_article_publication_issue = array (
0 => array(
'nid' => $issue_nid,
),
);
...
// save node object
$article_node = node_submit($article_node);
node_save($article_node);
The get_nid function would be something like this (only works for fields like 'title' that are in the {node} table itself) or a simplified version of it:
/**
* Return the nid of a node if it exists
*
* @param $field_name
* The field name upon which the query is based.
* @param $field_name_string
* The string uniquely (in this case)
* identifying the node we are searching for.
* @param $type
* The identifier of the content type.
* @return
* $nid or false
*/
function get_nid ($field_name, $field_name_string, $type) {
return db_result(db_query("SELECT nid FROM {node} WHERE %s = '%s' AND type = '%s'",
$field_name, $field_name_string, $type));
}
Hope that helps...
Victor Kane