title: Getting data from table in a modal by checkbox
body: <p>I'm having trouble inserting data from a table in a modal div into the table element where I want to display the content based on the data selected by the checkbox when I click the "Add" button.</p>
  
  <p>Here is my code:</p>
  
  <p>Modal's table code:</p>
  
  <hr>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="modal fade" id="mod_search" role="dialog"&gt;
          &lt;div class="modal-dialog modal-lg"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;Members&lt;/h4&gt;
                  &lt;/div&gt;
  
                  &lt;div class="modal-body"&gt;
  
                      &lt;table class="table table-hover table-managed"&gt;
                          &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;ID&lt;/th&gt;
                              &lt;th&gt;Name&lt;/th&gt;
                              &lt;th&gt;Speciality&lt;/th&gt;
                          &lt;/tr&gt;
                          &lt;/thead&gt;
                          &lt;tbody&gt;
                          &lt;?php
                          $sql_search = "SELECT * FROM `personal_profile`";
                          $sql_run = mysql_query($sql_search);
                          while($m = mysql_fetch_array($sql_run))
                          {
  
                          ?&gt;
                          &lt;tr&gt;
                              &lt;td&gt;&lt;input type="checkbox" name="member_select[]"&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;?php echo @$m['lastname'].', '.@$m['firstname'].' '.@$m['middlename'];?&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;?php echo @$m['speciality'];?&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;?php
                          }
                          ?&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt;
                  &lt;/div&gt;
  
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-success" name="add_button" id="button_add"&gt;Add&lt;/button&gt;
                      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p>Table of selected data code:</p>
  
  <hr>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="form-group"&gt;
          &lt;div class="col-md-8 col-md-offset-2"&gt;
  
              &lt;table class="table table-managed table-hover"&gt;
                  &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;No.&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Speciality&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                  &lt;tr&gt;
                      &lt;?php
                      $sql_select="SELECT * FROM `event_attendees` WHERE `id`='".@$_REQUEST['member_select']."'";
                      $sql_run=mysql_query($sql_select);
  
                      while($row=mysql_fetch_array($sql_run))
                      {
  
                      }
                      ?&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td id="name_row"&gt;&lt;/td&gt;
                      &lt;td id="speciality_row"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <hr>
  
  <p>Hope you can help me. I've been looking on the internet but nothing was exactly related to my issue.</p>
  
  <p>Here are the images:</p>
  
  <p>The 1st image is the modal that displays when you click "Search" if the "Member" radio button is selected from the original page (2nd image).</p>
  
  <p><a href="https://i.stack.imgur.com/pl44F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pl44F.png" alt="Modal"></a>
  <a href="https://i.stack.imgur.com/oWaHt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oWaHt.png" alt="enter image description here"></a>  </p>