Error prepping statement : Unknown column 'subject_shortcode' in 'where clause' -- SELECT distinct(courses.ippcode), urltitle, courses.title, fullTime, partTime, postGrad, underGrad, researchDegree, courses.year FROM courses LEFT JOIN projects on projects.ippcode = courses.ippcode WHERE courses.year = ? AND ( 1=0 OR 1 = 1 ) AND subject_shortcode = ? AND ( ( ( ( ( MONTH(NOW()) < 10 AND MONTH(NOW()) > 8 ) OR ( MONTH(NOW()) = 10 AND DAYOFMONTH(NOW()) < 16 ) ) AND YEAR(NOW()) = YEAR(courses.StartDate) ) OR StartDate > CURDATE()) OR shortCourse = '1' ) ORDER BY title