frank1 has asked for the wisdom of the Perl Monks concerning the following question:
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Server-side processing?
by marto (Cardinal) on Feb 14, 2024 at 10:27 UTC | |
by frank1 (Monk) on Feb 14, 2024 at 12:07 UTC | |
by marto (Cardinal) on Feb 14, 2024 at 12:12 UTC | |
by frank1 (Monk) on Feb 14, 2024 at 12:41 UTC | |
by marto (Cardinal) on Feb 14, 2024 at 13:09 UTC | |
by hippo (Archbishop) on Feb 14, 2024 at 13:52 UTC | |
by 1nickt (Canon) on Feb 14, 2024 at 12:49 UTC | |
| |
|
Re: Server-side processing?
by Corion (Patriarch) on Feb 14, 2024 at 07:21 UTC | |
|
Re: Server-side processing?
by karlgoethebier (Abbot) on Feb 15, 2024 at 11:45 UTC |