I need some help on server side processing for datatable, i want to be able to handle over 300k records, and i was advised to use server side processing method
its my first time server side processing trying in perl
my main point is that, if i have PERL Script
my $INFO = $DBH->prepare("SELECT SND.ACC, M.ID, M.FULLNAME FROM U_REC as M JOIN U_USERS as SND ON SND.ACC = M.ID WHERE CASE WHEN (SELECT SUM(st +atus = ?) FROM U_REC) > 0 THEN M.status = ? ELSE M.status = ? OR M. +status = ? OR M.status = ? END ORDER BY created ASC"); $INFO->execute('new', 'ne1', 'ne2', 'ne3', 'ne4'); my (@data,$ACC,$ID,$FULLNAME); foreach (@data = $INFO->fetchall_arrayref()) { $ACC = $data[0]; $ID = $data[1]; $FULLNAME = $data[2]; }
Then how do i return results to html
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.ne +t/v/bs-3.3.7/jq-3.3.1/dt-1.10.18/datatables.min.css"/> <script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq +-3.3.1/dt-1.10.18/datatables.min.js"></script> <script type="text/javascript" src="https://stackpath.bootstrapcdn.com +/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script> <script> jQuery(function($){ $("#table_id").DataTable({ "processing": true, "serverSide": true, "ajax": "general/events/file.pl" }); }); </script> </head> <body> <h1>sample dataTable</h1> <table id="table_id" class="table table-hover"> <thead> <tr> <th></th> <th></th> </tr> </thead> <tbody> <tr> <td>Ex: (10123) #ID goes here</td> <td>Ex: (Jane Deo) #Fullname goes here</td> </tr> <tr> <td>Ex: (20911) #ID goes here</td> <td>Ex: (John Deo) #Fullname goes here</td> </tr> </tbody> </table> </body> </html>
In reply to Server-side processing? by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |