Bootstrap Modal窗口内的数据获取

时间:2015-10-21 14:21:35

标签: php html twitter-bootstrap

<table class="table table-bordered">
        <tr>
            <th>Model Code</th>
            <th>Size</th>
            <th>Type</th>
            <th>Price</th>    
            <th>Specs</th>
        </tr>
        <?php
            while($row = $result->fetch_assoc()){
                $f1=$row['model_code'];
                $f2=$row['size'];
                $f3=$row['type'];
                $f4=$row['price'];
                $f5=$row['specs']; 
        ?>
        <tr>
            <td><?php echo $f1 ?></td>
            <td><?php echo $f2 ?></td>
            <td><?php echo $f3 ?></td>
            <td><?php echo $f4 ?></td>
            <td>
                <!-- Button trigger modal -->
                <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">SPECS</button>

                <!-- Modal -->
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                  <div class="modal-dialog" role="document">
                    <div class="modal-content">
                      <div class="modal-header">
                        <h2 class="modal-title text-center" id="myModalLabel"><?php echo $f1 ?></h4>
                      </div>
                      <div class="modal-body">
                           <div class="froala-view">
                                <?php echo $f5 ?>
                           </div>
                      </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
                      </div>
                    </div>
                  </div>
                </div>
            </td>
        </tr>
        <?php 
            } //while ends here
        ?>
    </table>

我正在尝试从我的数据库中获取数据。其他部分没问题。但是在bootstrap模式中哪个不能获取新数据。它只获取表的第一个数据。 我该怎么办?

0 个答案:

没有答案