title: How do I pass ID value of table in modal
body: <p>I want to pass the id value of student in the modal form.  When I clicked the button 1stgrade, here is my table code: </p>
  
  <pre><code>&lt;tbody&gt;
  &lt;?php
  require_once '../dbconfig.php';
  
  $stmt = $db_con-&gt;prepare("SELECT * FROM userinfo WHERE role='student' AND gradelvl='7' AND sectionname='$_POST[table7]' ORDER BY lrnno ASC");
  $stmt-&gt;execute();
  while($row=$stmt-&gt;fetch(PDO::FETCH_ASSOC))
  {
  ?&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $row['fname']; ?&gt;&lt;/td&gt;
  </code></pre>
  
  <p>and this is my modal form: </p>
  
  <pre><code>&lt;td&gt;
      &lt;div align="center"&gt;
          &lt;form action="studentprofilegradeaction.php" method="POST" class="form-horizontal"&gt;
              &lt;input type='text' name='id' value='&lt;?php echo $row['id']; ?&gt;' /&gt;
              &lt;!-- Button HTML (to Trigger Modal) --&gt;
              &lt;a href="#1stgrade7"  class="btn btn-info" data-toggle="modal"&gt;&lt;i class="fa fa-building"&gt;&lt;/i&gt;1st&lt;/a&gt;
              &lt;!-- Modal HTML --&gt;
  
              &lt;div id="1stgrade7" class="modal fade"&gt;
                  &lt;div class="modal-dialog"&gt;
                      &lt;div class="modal-content"&gt;
                          &lt;div class="modal-header"&gt;
                              &lt;input type='text' value='&lt;?php echo $row['id'] ?&gt;' /&gt;
  
                              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                              &lt;h2 class="modal-title"&gt;Please Fill Correctly&lt;/h2&gt;
                          &lt;/div&gt;
                          &lt;div class="modal-header"&gt;
                              &lt;h4 class="modal-title"&gt;1st Grading Result &lt;/h4&gt;
                          &lt;/div&gt;
  
                         &lt;div class="modal-body"&gt;
                             &lt;div align="left"&gt;
                                  &lt;b&gt;Filipino:&lt;/b&gt;
                                  &lt;input type="text" class="form-control" name="c71stgfilipino" &gt;
                             &lt;/div&gt;
  </code></pre>
  
  <p>I want to pass the id number to modal 1stgrade.</p>