Hi all
( delete part of earlier post )
Okay maybe not the best post ill try to explain what i am doing.
I need to migrate a website from plain php to drupal. This web site pulls its information every hour from a database in XML format. I have already written a parser for it so i have the data in a page in drupal. This data is stored in a array.
I now need to import this data from this array to the drupal data base. I have created a content type that is correct. The data i am getting is checked before it goes in the database on the other end so i do not need to check it.
I have looked at drupal_form_submit but i do not need it checked. So node_save should do it to.
I do not have any data from this type in my database. I checked if i had a NID but i do not. I do have a node type so i shoud use that.
<?php
$title = 'Test Title';
$node = new stdClass();
$node = array();
$node['type'] = 'content_type'; // put my content my content type in here
$node['uid'] = 1;
$node['title'] = $title;
if ($node = node_submit($node)) {
node_save($node);
}
?>
I am getting errors like --->
Warning: Attempt to assign property of non-object in node_submit() (line 1019
Notice: Undefined index: field_name in _field_invoke()