Programmatically creating a node
This will work for you:

$node = new stdClass();
$node-&gt;title = "My title";
$node-&gt;type = "mycontent";
node_object_prepare($node); 
$node-&gt;uid = $user-&gt;uid; 
$node-&gt;status = 1;
$node = node_submit($node);
node_save($node);


More details you can see at
https://www.drupal.org/docs/7/howtos/create-a-node-in-code