title: Codeigniter dropdown form with form_helper input is index/key instead of the value selected
body: <p>I am new to codeigniter and trying to make a dropdown using form helper. I have made regular input forms but now I would like to retrieve options from my database to populate my dropdown. It seemed like I had most of this working(If I make the input a regular text field I can make changes), but when I try to run my update function I get a database error because for some reason I'm getting the index/key of the selection rather than the actual value that I am trying to use to update the database(I'm also trying to use jquery to dynamically affect another dropdown but am not quite there yet...).</p>
  
  <p>My part of my form that is related to this question: </p>
  
  <pre><code>echo form_label('Stage');
  echo form_dropdown('stage_name', $stage_options, $stage[0]-&gt;stage_name, 
  'id=
  stagesDrp"');
  </code></pre>
  
  <p>My model methods that are related: </p>
  
  <pre><code>function get_stage_options($id){
    $this-&gt;db-&gt;select('stages.stage_name')-&gt;from('stages')-     
  &gt;join('prices', 'prices.id=stages.price_id')- 
  &gt;join('events','events.price_id=prices.id')-&gt;where('events.id', $id);
    $stage_options=$this-&gt;db-&gt;get();
    if($stage_options-&gt;num_rows()&gt;0)
    {
      foreach($level_options-&gt;result() as $row)
      {
        $options[]=$row-&gt;stage_name;
      }
      return $options;
    }
  
   function update_stage($id){
    $stage=array(
      'stage_name'=&gt;$this-&gt;input-&gt;post('stage_name')
    );
  
    $this-&gt;db-&gt;where('events.id', $id);
    $this-&gt;db-&gt;update('stages', $stage_name);
  
  }
  </code></pre>
  
  <p>When I try to submit my update form, I get a database error because it's trying to set stage_name = an index value (i.e. 0, 1, 2) based on which selection is made, instead of equal to the actual stage_name. </p>
  
  <p>Maybe I am missing a simple step? I really appreciate the help!</p>