php - Bootstrap show info based on id in modal -


i want show more info file database using modal instead adding more columns table, , instead of opening new page. here code

<table id="file" class="table table-bordered table-striped table-hover">      <?php             $result = mysql_query("select * files")       ?>     <thead>       <tr>       <th>id <i class="fa fa-sort"></i></th>       <th>name <i class="fa fa-sort"></i></th>       <th>size <i class="fa fa-sort"></i></th>       <th>delete </th>       </tr>     </thead>     <tbody>     <?php                 while($row = mysql_fetch_array( $result )) {      ?>        <tr class="record">         <td><?php echo $row['id'];?></td>         <td><?php echo  $row['name']; ?> </td>     <td><?php echo  $row['size']; ?> </td>     <td><div align="center"><a href="#" id="<?php echo  $row['id'] ?>" class="infobutton fa fa-times" title="info"></a></div></td>         <td><div align="center"><a href="#" id="<?php echo  $row['id'] ?>" class="delbutton fa fa-times" title="click delete"></a></div></td>        </tr>       <?php      }       ?>      </tbody> </table> 

thanks in advance. if there other way place it.

you can replace following data-target , modal id php, if mean.

    <!--this calls modal data-target id -->     <a data-toggle="modal" data-target="#mymodal">this link calls modal</a>       <!--modal content-->     <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">    <div class="modal-dialog">    <div class="modal-content">    <div class="modal-header">    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>     <h4 class="modal-title" id="mymodallabel"></h4>     </div>   <div class="modal-body">  <!--  content goes here  -->    </div>   <div class="modal-footer">     <center><button type="button" class="btn btn-default" data-dismiss="modal">cancel</button></center>   </div> </div> 


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -