title: How to insert all values into database using drupal 7
body: <p>I am trying to insert values into database in Drupal 7 but It is inserting only first and one record. Here is my code:</p>
  <pre><code>    $node = node_load($node-&gt;nid);
  
      $result = db_select('network_drive_listing', 'n')
      -&gt;fields('n', array('filename'))
      -&gt;condition('n.is_dir',0)
      -&gt;distinct()
      -&gt;range(0, 10)
      -&gt;execute()
      -&gt;fetchAll();
  
      $node-&gt;field_select_images[$node-&gt;language][0]['nid'] = $result; // Here I am assigning values of database
  </code></pre>
  <p>Above in $result I am getting 10 values if I dump but It is inserting only 1 record into database. Where I am doing wrong?</p>