problem with ID
problem with ID
i have code for my MySQL code like this::
//codeee php
<?php
//mmebuat koneksii dengan mysql dan database
$link = new mysqli('localhost','root','','ews_windstrom');
//check koneksi
if(!$link)
{
die('koneksi gagal :'.$link->errno()." - ".$link->error());
}
echo "koneksi sukses ".mysql_get_host_info()."<br/>";
$select_tb = $link->query('SELECT * FROM data_angin ORDER BY id LIMIT 10');
$json_conv = array();
while( $data_json = $select_tb->fetch_assoc())
{
$json_conv [] = $data_json;
}
echo json_encode($json_conv);
$link->close();
<?php > //end code php ?>//code table
and code mytable like this::
No | Arah | Kecepatan | Lokasi | Kategori | Waktu |
---|---|---|---|---|---|
No | Arah | Kecepatan | Lokasi | Kategori | Waktu |
</body>
$(document).ready(function(){ $('#myTable').DataTable({ "bProcessing" : true, "pagingType" : "numbers", "sAjaxSource" : "oop.php", "aoColumns" : [ { Datas : 'No' }, { Datas : 'Arah' }, { Datas : 'Kecepatan' }, { Datas : 'Lokasi' }, { Datas : 'Kategori' }, { Datas : 'Waktu' }, ] }); });//end code table
//alert
but i got the alert like this::
DataTables warning: table id=myTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
how can i fix this problem thanks for your attention
This question has an accepted answers - jump to answer
Answers
You have to follow the diagnostic steps explained at that message link.
Also please format your code using Markdown