jsonobjects sudently return empty jsonobjects sudently return empty json json

jsonobjects sudently return empty


NAME is a reserved keyword in MYSQL, I bet you shall change the column name to something like objects_name, then you fetch the query properly. Or you can quote the columns, like :

$sql = "select `ID`,`NAME`, `URL` from `OBJECTS`";


It seems what mysqli_fetch_array($res)) returns empty result.You can check this: add echo into cycle:

while($row = mysqli_fetch_array($res)) {    print_r($row);    array_push($result,    array(        'ID'=>$row[0],        'NAME'=>$row[1],        'URL'=>$row[2]    ));}

Check also connect with database. Add these two lines before connect to show errors

error_reporting(E_ALL);ini_set('display_errors', 1);