如何更快地将mysql数据加载到jquery数据表中
问题描述:
您好我正在使用jquery数据表插件来加载mysql数据到目前为止它的布莱恩好,但是当记录更多的数据表得到相对较慢的加载,所以现在我卡在这里并没有什么具有如此做的想法任何人都可以帮我在这 这里是我的代码如何更快地将mysql数据加载到jquery数据表中
<?php
$result = mysql_query("SELECT * FROM `mdb` ORDER BY grno");
?>
$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})
<table id="datatables" class="display">
<thead>
<tr>
<th>Srno.</th>
<th>Brno.</th>
<th>Name</th>
<th>Address</th>
<th>City</th>
<th>Pin</th>
<th>Mobile</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td align='center'>$row[grno]</td>";
echo "<td align='center'>$row[brno]</td>";
echo "<td align='center'>$row[name]</td>";
echo "<td align='center'>$row[address]</td>";
echo "<td align='center'>$row[city]</td>";
echo "<td align='center'>$row[pin]</td>";
echo "<td align='center'>$row[mobile]</td>";
echo "<td><a href=\"entry.php?vouchno=$row[vouchno]\"><img src='images/edit.png'></a> <a href=\"delete.php?code=$row[vouchno]\" onClick=\"return confirm('Confrim Delete?');\"><img src='images/delete.png'></a></td>";
echo "</tr>";
}
?>
</tbody>
</table>
不用多说了:http://www.datatables.net/development/pagination AND http://datatables.net/usage/server-side – 2013-04-30 16:30:22