The problem is this code since it does not correctly test for null (the array is associative and usually does not have a zero index):
156 /* simple test to catch null inpit */
157 if ($features[0]==null) {
158 $message = "null is given as input in the parameter of DBMySQL.getNumResults()";
159 throw new Exception($message);
160 }.