title: Getting human readable names for forms
body: <p>I have been working on this for the past 4 hours, with problem after problem. Now that I have finally come to the end of most of my problems, I can't seem to get a solution to the final problem. </p>
  
  <p>Problem: I have to send out an email to a student (email is stored in DB). In the email there has to be an un-ordered list with list items. That part was the easy part (html email). The problem that I am now facing is that I want to get the actual name of the form, not the value because the value is just </p>
  
  <blockquote>
    <blockquote>
      <p>value="1" value="2" </p>
    </blockquote>
  </blockquote>
  
  <p>That won't provide the student with much info to what the forms are. </p>
  
  <p>These are my input fields: </p>
  
  <pre><code>&lt;label id="form"&gt;&lt;input type="checkbox" name="form[]" value="3" &gt;DECSP&lt;/label&gt;
  &lt;label id="form"&gt;&lt;input type="checkbox" name="form[]" value="4" &gt;DESNAP&lt;/label&gt;
  </code></pre>
  
  <p>If you notice the value again is just a number, I want to actually get the NAME of the form which DESCP and DESNAP </p>
  
  <p>This is what I tried: </p>
  
  <pre><code>$body .= '&lt;ul&gt;';
  
  $forms = $this-&gt;input-&gt;post('form'); // The check boxes 
  $dbforms = $this-&gt;queue_model-&gt;first10() + $this-&gt;queue_model-&gt;elev9() + $this-&gt;queue_model-&gt;twenty_5() + $this-&gt;queue_model-&gt;twen8thir7() + $this-&gt;queue_model-&gt;checklists(); // Here I take the forms from the database and combine the arrays
  
  
  $givenforms = array_intersect_assoc($dbforms, $forms); // Here I do an intersect where form_id matches the value
  
  foreach ( $givenforms as $key =&gt; $value) { // If a match is good then give me the form_name
  $body .= '&lt;li&gt;' . $value . '&lt;/li&gt;';
  }
  
  $body .= '&lt;/ul&gt;';
  </code></pre>
  
  <p>I am quite confused as to where to go from here. Hopefully you guys understand. </p>
  
  <p>The only thing I can possibly think of is to do a </p>
  
  <blockquote>
    <p>foreach</p>
  </blockquote>
  
  <p>loop over all the forms that where checked in the check boxes, then in a query </p>
  
  <blockquote>
    <p>select * forms where form_id = (what form was checked)</p>
  </blockquote>
  
  <p>then </p>
  
  <blockquote>
    <p>return</p>
  </blockquote>
  
  <p>the actual name of the form. </p>
  
  <p>But again, I do not know if this would be a proper solution. Thanks in advance for any information that you guys could pass along. </p>
  
  <blockquote>
    <p><strong>Edit 1 :</strong></p>
  </blockquote>
  
  <p>The check boxes have to be an array so that I can store in the database which forms a student received. Take a look at my <a href="https://stackoverflow.com/questions/15869827/how-to-set-up-db-codes-for-forms">other question.</a></p>