Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 引导根据modal中的id显示信息_Php_Jquery_Html_Mysql_Twitter Bootstrap - Fatal编程技术网

Php 引导根据modal中的id显示信息

Php 引导根据modal中的id显示信息,php,jquery,html,mysql,twitter-bootstrap,Php,Jquery,Html,Mysql,Twitter Bootstrap,我想使用modal从数据库中显示更多关于文件的信息,而不是向表中添加更多列,也不是打开新页面。 这是我的密码 <table id="file" class="table table-bordered table-striped table-hover"> <?php $result = mysql_query("SELECT * FROM files") ?> <thead> <tr>

我想使用modal从数据库中显示更多关于文件的信息,而不是向表中添加更多列,也不是打开新页面。 这是我的密码

<table id="file" class="table table-bordered table-striped table-hover">
     <?php
            $result = mysql_query("SELECT * FROM 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 To Delete"></a></div></td>
       </tr>

     <?php
     } 
     ?>
     </tbody>
</table>

身份证件
名称
大小
删除
提前谢谢。
如果有其他方法,请说出来。

您可以用PHP替换以下数据目标和模式ID,如果这是您的意思的话

    <!--This calls the modal by data-target ID -->
    <a data-toggle="modal" data-target="#myModal">This link calls the 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">

<!--  your content goes here  -->

  </div>
  <div class="modal-footer">
    <center><button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button></center>
  </div>
</div>

此链接称为模态
&时代;
取消

但我认为会有很多代码,特别是当我有超过1000行时!你可以将任意多的内容放入一个模式中,它们可以有一个侧滚动条。不,当我使用此代码时,它将与我拥有的记录数一起复制,因此我认为页面将加载得非常慢。我认为你需要决定一次加载多少行。也许可以看看其他的用户体验方法。就像用户滚动到底部时加载内容一样。