$node = new stdClass();
$node->title = "title"
$node->type = "node_type_name";
$node->language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled
$node->uid = $uid;
$node->status = 1;
$node->promote = 0; //(1 or 0): promoted to front page
$node->comment = 1; // 0 = comments disabled, 1 = read only, 2 = read/write
$node->created = strtotime("now");
$node->changed = strtotime("now");
$node->moderate = 0;
$node->sticky = 0;
$node->tnid = 0;
$node->revision = 1;
$node->translate = 0;
// add CCK field data
$node->field_enrollment_id[$node->language][0]['value'] = '111';
$node->field_enrolled_on[$node->language][0]['value'] = strtotime("now");
$node->field_enrollment_status[$node->language][0]['value'] = 'ns';
$node->field_user_id[$node->language][0]['uid'] = $uid;
$node->field_class_id[$node->language][0]['nid'] = $nid;
$node = node_submit($node); // Prepare node for saving
node_save($node);
$node->title = "title"
$node->type = "node_type_name";
$node->language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled
$node->uid = $uid;
$node->status = 1;
$node->promote = 0; //(1 or 0): promoted to front page
$node->comment = 1; // 0 = comments disabled, 1 = read only, 2 = read/write
$node->created = strtotime("now");
$node->changed = strtotime("now");
$node->moderate = 0;
$node->sticky = 0;
$node->tnid = 0;
$node->revision = 1;
$node->translate = 0;
// add CCK field data
$node->field_enrollment_id[$node->language][0]['value'] = '111';
$node->field_enrolled_on[$node->language][0]['value'] = strtotime("now");
$node->field_enrollment_status[$node->language][0]['value'] = 'ns';
$node->field_user_id[$node->language][0]['uid'] = $uid;
$node->field_class_id[$node->language][0]['nid'] = $nid;
$node = node_submit($node); // Prepare node for saving
node_save($node);
Thanks for sharing this.
ReplyDeletehttp://ankitchauhan22.blogspot.com