doushang3352 2018-07-07 16:08
浏览 512

如何在php中动态获取特定的行数据

Developers, I am developing a School Management system I put many data in data base and i also able to fetch each data in table

<table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>Sr.</th>
                    <th>Pic</th>
                    <th>Registration Number</th>
                    <th>Name</th>
                    <th>Father Name</th>
                    <th>Class</th>
                    <th>CNIC</th>
                    <th>More</th>
                </tr>
            </thead>
            <tbody>
            <?php $q=mysqli_query($dbc,"SELECT * FROM students WHERE class='Play Group'");
                    if ($r=mysqli_num_rows($q)>0 )?>
                        <?php while ($r=mysqli_fetch_array($q)): ?>
                <tr>
                    <td><?=$r['students_id']?></td>
                    <td><img width="40" class="img img-circle" src="uploads/<?=$r['students_pic'];?>" alt=""></td>
                    <td>LSPS-10<?=$r['students_reg']?></td>
                    <td><?=$r['students_name']?></td>
                    <td><?=$r['fname']?></td>
                    <td><?=$r['class']?></td>
                    <td><?=$r['cnic']?></td>
                    <td>
                        <a class="label label-primary" data-toggle="modal"  data-target="#modal-id">View</a>    
                             <div class="modal fade" id="modal-id">
                                <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">Full Record</h4>
                                        </div>
                                        <div class="modal-body">
                                        <h1>Ok</h1>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                        </div>
                                    </div>
                                </div>
                             </div>      
                    </td>
                </tr>
            <?php endwhile ?>
            </tbody>
            </table>

but i fetech some of columns of that data now i want to fetch the rest of the columns in the modal which created dynamically in other words i fetch half data in table columns and others data in table inside modal my problem is how to fetch the rest of column in modal parallel to the data means when someone trigger modal all the data of clicked id modal is fetched which is fetched already.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 公交车和无人机协同运输
    • ¥15 stm32代码移植没反应
    • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
    • ¥100 连续两帧图像高速减法
    • ¥15 组策略中的计算机配置策略无法下发
    • ¥15 如何绘制动力学系统的相图
    • ¥15 对接wps接口实现获取元数据
    • ¥20 给自己本科IT专业毕业的妹m找个实习工作
    • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
    • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)