SELECT
EP_AUTHEN_STU.ACADYEAR,
EP_AUTHEN_STU.COURSEID,
EP_AUTHEN_STU.COURSETITLE,
EP_CATAGORY.CATID,
EP_CATAGORY.CATNAMEE,
EP_CATAGORY.CATNAMET
FROM EP_CATAGORY LEFT JOIN EP_AUTHEN_STU
ON EP_CATAGORY.CATID=EP_AUTHEN_STU.CATID AND EP_AUTHEN_STU.USERID=$UserID