function DatabaseHandler::get_student_catalog_year

7.x DatabaseHandler.php DatabaseHandler::get_student_catalog_year($student_cwid)
6.x DatabaseHandler.php DatabaseHandler::get_student_catalog_year($student_cwid)
1 call to DatabaseHandler::get_student_catalog_year()
DatabaseHandler::get_student_majors_from_db in classes/DatabaseHandler.php
Returns an array (or CSV string) of major_codes from the student_degrees table for this student.

File

classes/DatabaseHandler.php, line 1210

Class

DatabaseHandler

Code

function get_student_catalog_year($student_cwid) {


  if (isset($GLOBALS ['db_get_student_catalog_year'][$student_cwid])) {
    return $GLOBALS ['db_get_student_catalog_year'][$student_cwid];
  }


  $catalog = 0;

  // Let's perform our queries.
  $res = $this->db_query("SELECT catalog_year FROM students
                      WHERE cwid = ?
                       ", $student_cwid);


  $cur = $this->db_fetch_array($res);
  if ($cur) {
    $catalog = intval($cur ["catalog_year"]);
  }

  $GLOBALS ['db_get_student_catalog_year'][$student_cwid] = $catalog;


  return $catalog;
}