function DatabaseHandler::get_degree_ids

7.x DatabaseHandler.php DatabaseHandler::get_degree_ids($major_code, $school_id = 0)
6.x DatabaseHandler.php DatabaseHandler::get_degree_ids($major_code, $school_id = 0)

File

classes/DatabaseHandler.php, line 1697

Class

DatabaseHandler

Code

function get_degree_ids($major_code, $school_id = 0) {

  $rtn = array();

  $bool_use_draft = FALSE;

  // Always override if the global variable is set.
  if (@$GLOBALS ["fp_advising"]["bool_use_draft"] == true) {
    $bool_use_draft = true;
  }

  $table_name = "degrees";
  if ($bool_use_draft) {
    $table_name = "draft_$table_name";
  }

  $res7 = $this->db_query("SELECT degree_id FROM $table_name
                            WHERE major_code = ?   
                            AND school_id = ?           
                            ", trim($major_code), $school_id);

  while ($cur7 = $this->db_fetch_array($res7)) {
    $rtn [$cur7 ["degree_id"]] = $cur7 ["degree_id"];
  }


  return $rtn;


}