function _DatabaseHandler::get_faculty_major_code

4.x _DatabaseHandler.php _DatabaseHandler::get_faculty_major_code($faculty_cwid)
5.x _DatabaseHandler.php _DatabaseHandler::get_faculty_major_code($faculty_cwid)

Looks in our extra tables to find out what major code, if any, has been assigned to this faculty member.

File

classes/_DatabaseHandler.php, line 1080

Class

_DatabaseHandler

Code

function get_faculty_major_code($faculty_cwid) {

  // Let's pull the needed variables out of our settings, so we know what
  // to query, because this is a non-FlightPath table.
  //$tsettings = $GLOBALS["fp_system_settings"]["extra_tables"]["human_resources:faculty_staff"];
  //$tf = (object) $tsettings["fields"];  //Convert to object, makes it easier to work with.  
  //$table_name = $tsettings["table_name"];		  

  $res = $this->db_query("SELECT * FROM faculty WHERE cwid = '?' ", $faculty_cwid);
  $cur = $this->db_fetch_array($res);

  return $cur ["major_code"];

}