Error in displaying large records!
Error in displaying large records!
Hello guys! I'm a very fan of using this DataTables jquery plugin. But I've noticed that when getting a large amount of record in database specifically 40,000 total data, there is a popup occur saying that "please see http://datatables.net/tn/1" then when I check the site, it's only for problem in getting "INVALID JSON". But when I limit my sql to 20,000 it works fine. Do this plugin has a limit in displaying records? refer to the code below! Hope you can help me guys! Thanks in advance
// SQL
select * from table_name LIMIT 20000; #works fine
select * from table_name LIMIT 40000; # popup error occur
// index.php
$('#code_list').dataTable( {
"bProcessing": true,
"sAjaxSource": 'ajax_request.php'
} );
// ajax_request.php
$jsondt = array ( 'aaData' => $array_data,
'sEcho' => 1,
'iTotalRecords' => 40000,
'iTotalDisplayRecords' => 40000
);
echo json_encode( $jsondt );
// SQL
select * from table_name LIMIT 20000; #works fine
select * from table_name LIMIT 40000; # popup error occur
// index.php
$('#code_list').dataTable( {
"bProcessing": true,
"sAjaxSource": 'ajax_request.php'
} );
// ajax_request.php
$jsondt = array ( 'aaData' => $array_data,
'sEcho' => 1,
'iTotalRecords' => 40000,
'iTotalDisplayRecords' => 40000
);
echo json_encode( $jsondt );
This discussion has been closed.
Replies
Likely your server is running out of ram or the process is taking too long and is terminated.
Sounds like you might want to use server-side processing and only return the rows needed for each display.
Allan