DataTable with Oracle DB
DataTable with Oracle DB
Hello,
First of all, DataTables is truly awesome, if I can do what i expect it to do it could save me so much time !
My problem is I want to fill the DataTable with the data from an Oracle DB with PHP.
I use the example here : https://datatables.net/development/server-side/php_oracle
But in this example I don't understand this part
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "WHERE rowsNumerator BETWEEN :iDisplayStart AND :iDisplayEnd";
}
How it can work because when && how the $_GET can get the iDisplayStart and iDisplayLength ?
Even if I set in my page:
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"iDisplayLength": 10,
"iDisplayStart": 20,
"ajax": "./Vue/display.php"
} );
} );
Because the $sLimit is empty, the bind here :
oci_bind_by_name($statmntFinal, ':iDisplayStart', $dsplyStart);
Doesn't work, there is no :iDisplayStart in the request so it give an ora 01036. It's logic but I don't know how to make the $_GET['iDisplayStart'] have a value.
Thank you, and sorry if I made some mistakes, English is not my native language !
This question has an accepted answers - jump to answer
Answers
That script uses the legacy server-side processing parameters but as you have DataTables 1.10 configured with
ajax
it will be sending the newer parameters. You would either need to have it sent the legacy parameters (see the docs) or update the script to use the new style.Allan
Yes, my bad
I will update it, and post it when it will be done.