Datatables loads all data

Datatables loads all data

asgsoftasgsoft Posts: 1Questions: 0Answers: 0
edited December 2012 in General
Hey guys,

I am new to datatables but I managed to find some code (over at: http://www.sharemycode.com/item/view/95/jquery-datatables-plugin-example-with-php-mysql) which I adapted to my my current table. It works fine, the only issue I have is the load time. It loads over 10,000 records and shows all of them before applying the formatting and paginating the records.

[code]
<?php
$con = mysql_connect("localhost", "root", "");

if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("newdl", $con);

$result = mysql_query("SELECT * FROM domains");
?>
<!DOCTYPE html>


DataTables






@import "media/css/demo_table_jui.css";
@import "media/themes/smoothness/jquery-ui-1.8.4.custom.css";



*{
font-family: arial;
}


$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})










Domain
PageRank
Text only coloum



<?php
while ($row = mysql_fetch_array($result)) {
?>


<?=$row['domain']?>


<?=$row['pr']?>

Text

<?php
}
?>





[/code]

Is there anyway we can get over that issue?

Many thanks :)
This discussion has been closed.