title: Drupal - How to update a CCK NodeReference field programmatically?
body: <p>I'm trying to create a node (B type) &amp; assign it to a A type node's CCK nodereference field using node_save() method. </p>
  
  <pre><code>$node_type_A = node_load($some_nid);
  $node_type_A-&gt;field_type_B_node_ref[]['nid'] = $node_type_B_nid;
  
  $node_type_A = node_submit($node_type_A);
  node_save($node_type_A);
  </code></pre>
  
  <p>As the result, a new B type node will be created, but no reference will be assigned to the A type node. any help would be appreciated.</p>