= 7) { $getterms = "select distinct TERM_CODE, TERM_DESC from BANINST1.Z_WEB_DEAN_PRES_LIST where TERM_CODE >= " . $min_term_code . " and TERM_CODE <= " . $max_term_code . " order by TERM_CODE DESC"; $results = oci_parse($Oracleconn, $getterms); oci_execute($results); while (($row = oci_fetch_array($results, OCI_ASSOC)) != false) { $term_array[] = ['term_code' => $row['TERM_CODE'], 'term_desc' => $row['TERM_DESC']]; } $term_json = json_encode($term_array); $fp = fopen($filename, 'w'); fwrite($fp, $term_json); fclose($fp); }