0
我很公平的noob當涉及到PHP和只是想知道如何我可以讓我的表分裂成頁面,因爲它有超過200,000記錄在數據庫中,如果有可能轉到表格的下一個/上一個頁面而不刷新網頁?移動到php桌面的下一個頁面沒有刷新
這是我的表,任何建議非常感謝!
a<?php
$query = "SELECT * FROM aliases where client_id='$userid' ORDER BY time_edit DESC";
$result = mysql_query($query);
if ($result->num_rows > 0) {
\t echo "<table border=1>";
\t echo "<tr align=center>";
\t echo "<th width=25%>Alias</th>";
\t echo "<th width=25%>Times Used</th>";
\t echo "<th width=25%>First Used</th>";
\t echo "<th width=25%>Last Used</th>";
\t echo "</tr>";
\t echo "<tr><td>No Results</td></tr>";
}
\t echo "<table border=1>";
\t echo "<tr>";
\t echo "<th width=25%>Alias</th>";
\t echo "<th width=25%>Times Used</th>";
\t echo "<th width=25%>First Used</th>";
\t echo "<th width=25%>Last Used</th>";
\t 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);
\t echo "<tr align=center>";
\t echo "<td>$alias</td>";
\t echo "<td>$timesused</td>";
\t echo "<td>$firstused</td>";
\t echo "<td>$lastused</td>";
\t echo "</tr>";
}
\t echo "</table>";
?>
檢出數據表插件並使用其服務器端分頁。 https://www.datatables.net/ – WillardSolutions
看看這個ajax分頁(http://www.sitepoint.com/pagination-jquery-ajax-php/) –
Datatables或類似的jsvascript插件肯定...與json飼料併爲這麼多的數據啓用服務器端處理選項 – charlietfl