getAll($sql); if( DB::isError($res) ) { set_response_code(500); echo json_encode(array('error' => $res->getMessage().". DEBUG: ".$res->getDebugInfo())); die(); } echo json_encode(array('results' => $res)); ?>