title: grocery crud : field type dropdown with custom array data
body: <p>Message: Undefined index: nm_pemohon</p>
  
  <p>whats wrong in my controller script</p>
  
  <pre><code>$this-&gt;load-&gt;model('pemohon_model');
  $data_pemohon = $this-&gt;pemohon_model-&gt;ambil_nama_pemohon();
  $crud-&gt;field_type('id_pemohon','dropdown', array($data_pemohon['id_pemohon'] = $data_pemohon['nm_pemohon']));
  </code></pre>
  
  <p>and i have this script in my model</p>
  
  <pre><code>function ambil_nama_pemohon()
      {
          $session_data = $this-&gt;session-&gt;userdata('logged_in');
          $this-&gt;db-&gt;select('id_pemohon, nm_pemohon');
          $this-&gt;db-&gt;where('insert_by ='.$session_data['id_user']);
          $this-&gt;db-&gt;order_by('id_pemohon','asc');
          $query = $this-&gt;db-&gt;get('tbl_pemohon');
          if ($query-&gt;num_rows() &gt; 0)
          {
              $data_pemohon = array();
              foreach ($query-&gt;result_array() as $row)
              {
                  $data_pemohon[$row['id_pemohon']] = $row['nm_pemohon']; 
              }
          }
          $query-&gt;free_result();
          return $data_pemohon;       
      }
  </code></pre>
  
  <p>please fix my script.</p>
  
  <p>sorry for my english</p>