title: how to extract checkbox information and store it in database with codeigniter
body: <p>I have this code in the php file. it lists all the interests as checkboxes and allows to input a text field "other". The user should select several of these interests and save. Now, when the user clicks on the submit button it should take it to the controller and controller should extract them and store it in the database. I have one file thats coded to do that, but its no good and too confusing.</p>
  
  <p>Here is the form in the normal php file</p>
  
  <pre><code>&lt;form method="post" action="&lt;?php echo site_url("userProfile/update_bio");?&gt;" name="editForm" id="edit-form"&gt;
  
  &lt;div&gt; &lt;!-- description start --&gt;
  &lt;div&gt; &lt;p &lt;p class="special-p"&gt;Name:&lt;/p&gt; &lt;hr&gt; &lt;/div&gt;
  &lt;p class="used-p"&gt; &lt;input type="text" name="name" value="&lt;?php echo $this-&gt;dx_auth-&gt;get_username(); ?&gt;"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;!-- should be real name --&gt;
  
  &lt;/div&gt; &lt;!-- description end --&gt;
  
  &lt;div&gt; &lt;!-- description start --&gt;
  &lt;div&gt; &lt;p &lt;p class="special-p"&gt;Description:&lt;/p&gt; &lt;hr&gt; &lt;/div&gt;
  &lt;p class="used-p"&gt; &lt;textarea name="description"&gt;&lt;/textarea&gt; &lt;/p&gt;
  
  &lt;/div&gt; &lt;!-- description end --&gt;
  
  &lt;div&gt; &lt;!-- interests start --&gt;
  &lt;div&gt; &lt;p class="special-p"&gt;Interests:&lt;/p&gt; &lt;hr class="special-hr2"&gt; &lt;/div&gt;
  &lt;p class="used-p"&gt;I am interested in:&lt;/p&gt;
  
  &lt;ul&gt;
  &lt;?php
  foreach ($allInterests-&gt;result() as $row){
  echo '&lt;li&gt;&lt;input type="checkbox" name="checks1[]" value="'.$row-&gt;id.'"/&gt; '.$row-&gt;name.'&lt;/li&gt;';
  
  
  }
  
  ?&gt;
  &lt;li&gt;&lt;input type="checkbox" name="checks1[]" value="other"/&gt; Other: &lt;input type="text" name="otherText"/&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;/div&gt; &lt;!-- interests start --&gt;
  
  &lt;div&gt;
  &lt;input id="editbutton" type="submit" value="Save" name="editBioButton" class="small green button"/&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>The controller function is empty. The problem is I don't know how will it receive the checkboxes.</p>
  
  <p>Thanx in advance</p>