Error in displaying large records!

Error in displaying large records!

kjjms10kjjms10 Posts: 1Questions: 0Answers: 0
edited February 2014 in General
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 );

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    If you are getting the error notice to for tech note 1, then the data returned from the server is invalid data - that error is coming from jQuery's JSON parser.

    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
This discussion has been closed.