I tried to parse database table data to jquery data table which are dynamically change. I got following output after php's json_encode function
$sql = "SELECT * FROM login";
$result = mysql_query($sql);
$a= array();
while ($row = mysql_fetch_assoc($result)) {
$a[][] = $row;
}
echo (json_encode($a));
Json output
[[{"id":"1","username":"test11","password":"$2y$10$NiKnEN\/ww8yGVhv3JNjSuO5FfOFSthadS2B3GcbA3KGBktAOSu6lK","role":"Administrator "}],[{"id":"2","username":"test","password":"test","role":"test"}]]
Then I called jquery data table ajax function as they said. here my coding for that
$('#example').dataTable( {
"ajax": 'ab.php'
} );
But ultimately display only "Loading..." text in the jquery data table tbody section. Why is that?