function DatabaseHandler::get_student_catalog_year

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 1239

Class

DatabaseHandler

Code

function 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 = $cur ["catalog_year"];
  }

  $temp = explode("-", $catalog);
  return trim($temp [0]);
}