My problem is that Jquery DataTables is hanging at Loading and will not display any data from the php script:
Here is my HTML:
<!-- Default box -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Time Management</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<table id="example" class="table table-bordered table-hover">
<thead>
<tr>
<th>ID</th>
<th>Clock In</th>
<th>Lunch Started</th>
<th>Lunch Ended</th>
<th>Clock Out</th>
</tr>
</thead>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer">
Footer
</div>
<!-- /.box-footer-->
</div>
<!-- /.box -->
My Jquery Code:
<script>
$(document).ready(function() {
$('#example').DataTable({
"ajax": "api/timemanageprocess.php",
"dataSrc": '',
"type": "POST",
"columns": [
{"data": "PASS_ID"},
{"data": "CLOCK_IN"},
{"data": "START_LUNCH"},
{"data": "END_LUNCH"},
{"data": "CLOCK_OUT"}
],
});
});
</script>
And my results from my PHP script. I echoed the results from json_encode():

I've tried to use "data": data & "data": json as options in DataTable(). I've tried to put curly brackets to define ajax's options. I've tried excluding dataSrc='' altogether, I've tried removing type: 'POST' and leaving it to GET. I know my php script address is correct. I don't know what it is or they are that is blocking the data from populating in Data Tables. Could someone help me figure it out? Thanks in advance. Help would be much appreciated.
PHP
include ('../includes/sessions.php');
$select = "SELECT PASS_ID, CLOCK_IN, START_LUNCH, END_LUNCH, CLOCK_OUT FROM timeclock WHERE USERNAME = '$sessuser'";
$query = mysqli_query($dbc, $select) or die(mysqli_error($dbc));
$resnum = mysqli_num_rows($query);
//echo $resnum;
while($row = $query->fetch_assoc())
{
$out[] = $row;
}
echo json_encode(array('data' => $out));
mysqli_free_result($query);
$dbc->close();
?>
