Я хочу использовать AJAX для загрузки данных из базы данных и отображения их с помощью DataTable. База данных загружена и ее можно увидеть, но Datatable показывает:

Показано с 0 по 0 из 0 записей (отфильтровано по количеству записей NaN)

{amp}lt;table id="employee_data" class="table table-striped table-bordered"{amp}gt; {amp}lt;thead{amp}gt; {amp}lt;tr{amp}gt; {amp}lt;td{amp}gt;ID{amp}lt;/td{amp}gt; {amp}lt;td{amp}gt;Name{amp}lt;/td{amp}gt; {amp}lt;td{amp}gt;Department{amp}lt;/td{amp}gt; {amp}lt;td{amp}gt;Job Title{amp}lt;/td{amp}gt; {amp}lt;td{amp}gt;Employee Type{amp}lt;/td{amp}gt; {amp}lt;td{amp}gt;Employee Status{amp}lt;/td{amp}gt; {amp}lt;/tr{amp}gt; {amp}lt;/thead{amp}gt; {amp}lt;/table{amp}gt; {amp}lt;script type="text/javascript" language="javascript"{amp}gt; $(document).ready(function(){ $('#employee_data').DataTable({ "processing" : true, "serverSide" : true, "order" : [], "searching" : true, "ajax" : { url: 'employeeData.php', type: "post", dataType: "json", contentType: "application/json; charset=utf-8" }, "columns": [ { "data": "eId"}, { "data": "eName"}, { "data": "eDepartment"}, { "data": "eJobTitle"}, { "data": "eEmployeeType"}, { "data": "eEmployeeStatus"} ] } ); }); {amp}lt;/script{amp}gt; 

employeeData.php

  $query =" SELECT * FROM employee ORDER BY employeeID DESC"; $result = mysqli_query($link, $query); $data = array(); while($row=mysqli_fetch_array($result)) { $data['data'][] = array( 'eId' ={amp}gt; $row['employeeId'], 'eName' ={amp}gt; $row['employeeLastName'], 'eDepartment' ={amp}gt; $row['department'], 'eJobTitle' ={amp}gt; $row['jobTitle'], 'eEmployeeType' ={amp}gt; $row['employeeType'], 'eEmployeeStatus' ={amp}gt; $row['employeeStatus'] ); } echo json_encode($data); в  $query =" SELECT * FROM employee ORDER BY employeeID DESC"; $result = mysqli_query($link, $query); $data = array(); while($row=mysqli_fetch_array($result)) { $data['data'][] = array( 'eId' ={amp}gt; $row['employeeId'], 'eName' ={amp}gt; $row['employeeLastName'], 'eDepartment' ={amp}gt; $row['department'], 'eJobTitle' ={amp}gt; $row['jobTitle'], 'eEmployeeType' ={amp}gt; $row['employeeType'], 'eEmployeeStatus' ={amp}gt; $row['employeeStatus'] ); } echo json_encode($data); 

введите описание изображения здесь