【发布时间】:2018-01-28 03:47:27
【问题描述】:
我有一个从数据库中获取数据的表
我想为表格进行分页但不刷新页面
我的表格代码:
<?php
<table id="table2" class="table table-hover table-mc-light-blue ">
<thead>
<tr>
<th>#</th>
<th>اسم المطرب</th>
<th>عدد الاغاني</th>
<th>تعديل</th>
</tr>
</thead>
<tbody class="searchable" >
<?php
$artistquery= mysqli_query($conn,"SELECT * FROM `artist` ORDER BY `artistID` DESC ");
$num=1;
$x=0;
while($listartist = mysqli_fetch_assoc($artistquery)){
$songquery= mysqli_query($conn,"SELECT * FROM `songs` WHERE `artist` = '$listartist[artistname]' ");
$songsnumber = mysqli_num_rows($songquery);
$x+=0.1;
echo'
<tr class="animated bounceIn " style=" animation-delay:'.$x.'s;">
<td data-title="#"></td>
<td data-title="اسم المطرب"></td>
<td data-title="عدد الاغاني"></td>
<td data-title=""></td>
</tr> ';}
?>
注意:我尝试过 DataTables.js,但我确实知道如何删除过滤器并显示标签。 有什么不同的方法吗?
【问题讨论】:
-
您需要一些 js+jquery 代码来发出 ajax 请求以获取另一个页面的数据,并使用 php 脚本来执行此操作
-
这样做有什么参考吗?我是这个的初学者
标签: javascript php jquery twitter-bootstrap pagination