[SOLVED] Loading fast
[SOLVED] Loading fast
Hello,
I started to use DataTable with 500 data and the json loading data was perfect to me, but i have more than 1000+ data to load and the drawing is slower, of course. I read about server side loading but I don't have mind how to change my code to avoid issues.
This is the fiddle: https://jsfiddle.net/m4fccz34/
This is the api_ricercautente_nl:
```
<?php
$type=getPar_empty("type",$_GET,"");
$out=array();
$stmt=null;
if ($type=="ricerca_utenti"){
$stmt=null;
$stmt=$db->prepare("select id,email,nome,cognome,lingua,unsubscribe from newsletter_utenti");
if (!$stmt) {
log_msg($db->error);
die();
}
$stmt->execute();
$row=fetchArray2($stmt);
$stmt->close();
$out['utenti'] = $row;
$db->close();
echo json_encode($out);
exit;
}
$db->close();
echo json_encode($out);
Thank you!
This question has an accepted answers - jump to answer
Answers
EDIT: I'm following this tutorial https://coderexample.com/datatable-demo-server-side-in-phpmysql-and-ajax/ but i receive the error: "TypeError: Cannot read property 'length' of undefined".
What's wrong? I'm so sorry but I'm a newbie.
search_user.php
JS Script
HTML
Thank you!
I deleted if ($type=="search"){ and now it works!