[support] How add a node into drupal database directly.

Gottwig, Jeremy M. (GSFC-272.0)[ZIMMERMAN & ASSOC.] jeremy.m.gottwig at nasa.gov
Fri Apr 16 12:43:14 UTC 2010


Here's a simple chunk of code for creating nodes.  Hopefully it will help:

$nodeArray = array(
    'type' => 'node_content_type', // Pick the content type you want the node to fall under
    'status' => '1', // Published or not
    'promote' => '0', // Promoted to front page or not
    'comment' => '0', // Allow comments or not
    'uid' => $user->uid, // User ID
    'date' => format_date(time(), 'custom', 'Y-m-d H:i:s O'),
);

node_validate($nodeArray);
$node = node_submit($nodeArray);
node_save($node);

-----Original Message-----
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On Behalf Of Nikhil Kala
Sent: Friday, April 16, 2010 7:40 AM
To: support at drupal.org
Subject: [support] How add a node into drupal database directly.

Hello,


Can any one has idea how to add a node into Drupal database directly 
without using drupal interface?
I want to migrate large database into Drupal database and want to create 
large number of nodes.

What things need for this ?
Can I use only SQL scripts only?


Thanks, 
Nikhil Kala
Blogs - http://www.nikhilkala.com 
Cell : +91-9822602183 | GTalk - kale.nikhil at gmail.com | skype - nikhilkaleus


-- 
[ Drupal support list | http://lists.drupal.org/ ]


More information about the support mailing list