Error : DataTables Warning (table id = 'abc')

Error : DataTables Warning (table id = 'abc')

fadekatefadekate Posts: 1Questions: 1Answers: 0
edited March 2015 in Free community support
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
            $('#example').dataTable( {
                "sAjaxSource": "data.php"
            } );
        } );
    </script>

here is my sever side script
i am collecting some information from multiple apis which are already based on json but i need to do some calculation on it so later i can i save those calculation in my local database. meanwhile i want to show data from apis in my tables too.
data.php

$api = "hxxp://www.api-url";
    $json = file_get_contents($api);

$array = json_decode($json, true);

$data = array();
foreach ($array['data'][$accid] as $item)
$data[] = array(
'account_id' => $item['account_id'],
'reg_number' => $item4['all']['registration_number']
);

print json_encode(array('aaData' => $data));
which is giving me follow output

{"aaData":[{"account_id":1,"join_date":1407609045,"reg_number":16},{"account_id":2,"reg_number":34},{"account_id":3,"reg_number":56}]}

my table giving me following error
DataTables Warning (table id = 'abc'): Requested unknown parameter '0' from the data source for row 0

i am new to this stuff of datatables and php as well.
but in my project only thing is left to make tables by combing data from one api and local database.
i tried to learn from the page http://datatables.net/tn/4 but being new here i cant understand most of it part so i thought maybe asking question might help me with something.
anyone please help.

This discussion has been closed.