function _DatabaseHandler::get_degree_tracks

4.x _DatabaseHandler.php _DatabaseHandler::get_degree_tracks($major_code, $catalog_year)
5.x _DatabaseHandler.php _DatabaseHandler::get_degree_tracks($major_code, $catalog_year)

File

classes/_DatabaseHandler.php, line 1682

Class

_DatabaseHandler

Code

function get_degree_tracks($major_code, $catalog_year) 
 {
  // Will return an array of all the tracks that a particular major
  // has.  Must match the major_code in degree_tracks table.
  // Returns FALSE if there are none.
  $rtn_array = array();

  static $degree_tracks_data_cache = array();
  if (isset($degree_tracks_data_cache [$catalog_year][$major_code])) {
    return $degree_tracks_data_cache [$catalog_year][$major_code];
  }

  $res = $this->db_query("SELECT * FROM degree_tracks
                WHERE major_code = ?
                AND catalog_year = ? ", $major_code, $catalog_year);
  if ($this->db_num_rows($res) < 1) 
   {
    $degree_tracks_data_cache [$catalog_year][$major_code] = false;
    return FALSE;
  }

  while ($cur = $this->db_fetch_array($res)) 
   {
    extract($cur, 3, "db");
    $rtn_array [] = $db_track_code;
  }

  $degree_tracks_data_cache [$catalog_year][$major_code] = $rtn_array;
  return $rtn_array;

}