title: PHP how to Submit many records after search
body: <p>I tried to look in this site but none of the question which relate exactly like mine. I need help on this problem since am very new in PHP. 
  Iam developing students result application which used to collect scores of the students. My problem is, I fail to submit all information I get like (idnumber, names and subject), after searching records of students of a certain class, here is my scripts.</p>
  
  <pre><code>   &lt;?php
          $number = $courseObj-&gt;sele_ct_class($class, $year);
          ?&gt;
                      &lt;table class="table table-bordered" style="border-radius: 100px" border="0"&gt;
                          &lt;tr style="font-size: medium; background-color: lavenderblush"&gt;
                              &lt;td&gt;#&lt;/td&gt;
                              &lt;td&gt;Admission Number&lt;/td&gt;
                              &lt;td&gt;Student name&lt;/td&gt;
                              &lt;td&gt;Max.Mark&lt;/td&gt;
                              &lt;td&gt;Mark&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;/thead&gt;
                          &lt;tbody&gt;
                          &lt;?php
          $i = 1;
          $notaVilableId = $courseObj-&gt;seleId($class, $year); // Select_all From curClass according to aguments (return all idnumber)
          foreach ($notaVilableId AS $haika) {
              $classIdnumber = $haika-&gt;idnumber;
              $jina = $haika-&gt;jina;
  
              ?&gt;
  
              &lt;tr&gt;
                  &lt;td style="width: 5%"&gt;&lt;?php echo $i++; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $classIdnumber ?&gt;&lt;/td&gt; &lt;!-- this display idnumber --&gt;
                  &lt;td&gt;&lt;?php echo $jina ?&gt;&lt;/td&gt; &lt;!-- this display name --&gt;
                  &lt;td&gt;100&lt;/td&gt;
                  &lt;td class="col-sm-2"&gt;&lt;input type="number" id="subject" name="subject" class="form-control"&gt;&lt;/td&gt; &lt;!-- this fiels used to input score marks --&gt;
              &lt;/tr&gt;
          &lt;?php } ?&gt; &lt;!-- end foreach --&gt;
  
                          &lt;tr&gt;
                              &lt;td colspan="20px"&gt;
                                  &lt;button class="btn btn-success" type="submit" name="fee_submit" id="fee_submit"&gt;Save
                                  &lt;/button&gt;  &lt;!-- submission button --&gt; 
                          &lt;/tr&gt;
  </code></pre>
  
  <p>Problem is here, I get only idnumber of one student and the rest not appear, can any one show me how I could get all information like (idnumber, name and subject score which entered for each student). I mean that I want all information displayed to be submited with there scrored marks. Thank</p>
  
  <pre><code>        &lt;?php
          if (isset($_POST['fee_submit'])) {
              $classIdnumber;
              $jina;
              $score = sanitize($_POST['subject']);
              $courseObj-&gt;insertseTExams($classIdnumber, $jina, $score); // function used to insert data
  
    }
  </code></pre>