Java / AJAX进程在开发框上工作但在远程Web服务器上没有

This Javascript code...

      var xmlhttp = new XMLHttpRequest();
      xmlhttp.open("GET", "get_status.php");
      xmlhttp.send();
      xmlhttp.onreadystatechange = function() {

        if (this.readyState === 4 && this.status === 200) {
            test_response = JSON.parse(this.responseText);

            console.log(test_response[0]);
            console.log(test_response[1]);

...calls this php code...

        $result = pg_query('select max(num_files), max(file_num) from status');
        $num_files = pg_fetch_row($result);

if ($num_files[0] === $num_files[1] ) {
    pg_query('truncate table status');
}

echo json_encode($num_files);

Note the console.log statements in the first code snippet. At run time, the console is showing values of "null" for both of these values.

But the "status" table has non-null values in it so I'm not sure what is going on.

Additionally, this code is running fine on development machine in case that is a clue, i.e. something in php.ini or postgres configuration file?

Another clue might be that the "status" tables is not getting truncated as it should, i.e. something going on with array or logic?

Also, the purpose of the code above is to determine status of data processing that is happening in a separate php file on uploaded files. So could be something related to multiple postgres connections being handled on servers vs on development machine?

Lastly, I have worked my way through and corrected all console and server log warnings and am no longer getting any warnings and also all other parts of the process are working correctly. Just this one status process is not working correctly.