简体   繁体   English

如何更快地将mysql数据加载到jquery datatable中

[英]how to load mysql data faster into jquery datatable

hi i am using jquery datatable plugin to load mysql data into it so far its goin good but when the records are more the data table gets relatively slow to load so now i am stuck here and have no idea of what has to be done so can anyone help me in this here is my code 嗨,我目前正在使用jquery datatable插件将mysql数据加载进去,但是当记录更多时,数据表的加载速度相对较慢,所以现在我被困在这里,不知道该怎么做,可以有人帮我这是我的代码

<?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>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"delete.php?code=$row[vouchno]\" onClick=\"return confirm('Confrim Delete?');\"><img src='images/delete.png'></a></td>";
               echo "</tr>";
           }
           ?>
    </tbody>
</table> 

Please have a look at here . 请在这里看看。

If you want to have server-side processing click here . 如果要进行服务器端处理,请单击此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM