{"748847":"Jane Deo"}
Did you look at any of the DataTables examples? Consider the following:
use DBI;
use JSON::XS;
my $host = "host";
my $usr = "user";
my $pwd = "pwd";
my $dbname = "datname";
my $dbh = DBI->connect("DBI:mysql:$dbname:$host", $usr, $pwd, {
RaiseError => 1,
}) or die $DBI::errstr;
my $json;
$json->{data} = $dbh->selectall_arrayref('SELECT idnum, fname FROM dbu
+ser', {Slice => {}} );
warn encode_json( $json );
print "Content-type: text/html\n\n";
JSON isn't html: application/json, and why are you manually printing headers when you're using CGI which has a method for that?