title: retrieve id from dropdown/select box codeigniter
body: <p>Im trying to figure how to retrieve the ID number from a selected value in a dropbox, displaying a list of projects from a table. </p>
  
  <p>At this point what i did was retrieve the value and then search it and get the ID number for that value in the table. Well the field name_project it's "unique" so it's not so bad but i want to retrive the id directly without querying the database offcourse! It's really necessary the use of jquery or javascript to do that?</p>
  
  <pre><code>&lt;?php echo form_open('solucao/inserir',array('class' =&gt; 'form-horizontal')); ?&gt;
   &lt;select class="form-control" id="project" name="project"&gt;
                              &lt;option&gt;--Choose Project--&lt;/option&gt;
                              &lt;?php foreach($projects as $data):?&gt; 
                              &lt;option&gt;&lt;?php echo $data-&gt;name_project?&gt;&lt;/option&gt;
                              &lt;?php endforeach;?&gt;  
                              &lt;/select&gt;
  &lt;?php form_close(); ?&gt;
  </code></pre>
  
  <p>Note: $data is an array wich contains the ID number!</p>
  
  <p>Thank you!</p>