移动到php表的下一页,无需刷新

时间:2016-02-23 19:07:40

标签: javascript php sql

对于php来说,我是一个相当的noob,我只是想知道如何将我的表分成页面,因为它在数据库中有超过200,000条记录,如果它可以进入表的下一页/上一页没有刷新网页?

这是我的表,任何建议都非常感谢!!!



a<?php
$query = "SELECT * FROM aliases where client_id='$userid' ORDER BY time_edit DESC";
$result = mysql_query($query);
if ($result->num_rows > 0) {
	echo "<table border=1>";
	echo "<tr align=center>";
	echo "<th width=25%>Alias</th>";
	echo "<th width=25%>Times Used</th>";
	echo "<th width=25%>First Used</th>";
	echo "<th width=25%>Last Used</th>";
	echo "</tr>";
	echo "<tr><td>No Results</td></tr>";
}
	echo "<table border=1>";
	echo "<tr>";
	echo "<th width=25%>Alias</th>";
	echo "<th width=25%>Times Used</th>";
	echo "<th width=25%>First Used</th>";
	echo "<th width=25%>Last Used</th>";
	echo "</tr>";
while ($row = mysql_fetch_assoc($result)) {
$timesused=$row['num_used'];
$alias=$row['alias'];
$alias=htmlentities($alias);
$firstused=$row['time_add'];
$firstused = date('d M Y H:i:s', $firstused);
$lastused=$row['time_edit'];
$lastused = date('d M Y H:i:s', $lastused);
	echo "<tr align=center>";
	echo "<td>$alias</td>";
	echo "<td>$timesused</td>";
	echo "<td>$firstused</td>";
	echo "<td>$lastused</td>";
	echo "</tr>";
}
	echo "</table>";
?>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

为您的单元格添加一个类:

[{  
  "UID": "34531513", 
  "identities": 
    [{
      "provider": "facebook",
      "providerUID": "123145517",
      "isLoginIdentity": true,
      "oldestDataUpdatedTimestamp": 145227161126
     },
     {
      "provider": "site",
      "providerUID": "321315415153",
      "isLoginIdentity": false,
      "oldestDataUpdated": "2015-07-14T13:37:43.682Z",
      "oldestDataUpdatedTimestamp": 1436881063682
      }]
},
{
 "UID": "1234155",
 "identities":
      [{
       "provider": "facebook",
       "providerUID": "123145517",
       "isLoginIdentity": true,
       "oldestDataUpdatedTimestamp": 145227161126
       }]
}]

在客户端使用javaScript,jQuery或您喜欢隐藏或显示它们的内容......

有插件可以像以前评论过的那样为你做... 这不是最好的答案,但我希望它可以帮到你。