Replace hardcoded $facultyGroupsArray for database query