title: Passing data from page to bootstrap modal using SQL & PHP
body: <p>So as per title, im trying to pass show multiple data from database using sql on the bootstrap modal. The ID will be pass down from the link, how is it done? been finding multiple way but I still can't show the selected data;</p>
  
  <p>So here is the trigger for the modal:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php  while($row = mysqli_fetch_array($adm_query)){
      $id = $row['admin_id'];  ?&gt;
  &lt;tr&gt;
   &lt;td style="text-align:center"&gt;&lt;?php echo $row['adm_name']; ?&gt;&lt;/td&gt;
   &lt;td width="150" style="text-align:center"&gt;&lt;?php echo $row['staff_no']; ?&gt;&lt;/td&gt;
   &lt;td width="120" style="text-align:center"&gt;&lt;?php echo $row['department']; ?&gt;&lt;/td&gt;
   &lt;td width="138" style="text-align:center;"&gt;
              
        &lt;a data-toggle="modal" data-target="#myModal" data-id="&lt;?php echo $row['admin_id']?&gt;" class="btn btn-outline btn-info"&gt;&lt;i class="fa fa-search-plus"&gt;&lt;/i&gt;&lt;/a&gt;
      &lt;/td&gt;
  &lt;?php  }?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Then this is the modal content:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- Modal --&gt;
  &lt;div style="margin-top:5%;" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
    &lt;?php $sel_query=mysqli_query($conn, "select * from admin where admin_id='$idmodal'")or die(mysql_error($conn)); $selrow=mysqli_fetch_array($sel_query);?&gt;
    &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
          &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;div class="panel panel-info" style="text-align:center;"&gt;
            &lt;div class="panel-heading"&gt;
              &lt;h4&gt;Staff Details&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="panel-body"&gt;
              &lt;div class="row"&gt;
                &lt;div class="col-lg-6"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Staff ID&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'staff_no']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Name&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'adm_name']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Services | Department&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'department']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;!-- /.col-lg-6 (nested) --&gt;
                &lt;div class="col-lg-6"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Username&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'username']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Password&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'password']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Date&lt;/label&gt;
                    &lt;p&gt;
                      &lt;?php echo $selrow[ 'date_added']?&gt;
                    &lt;/p&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
  
              &lt;/div&gt;
  
            &lt;/div&gt;
  
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
        &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;!-- /.modal-content --&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is nothing works, and i don't know where to start.
  Appreciate for the help.</p>