A more MySQL native approach:
WHERE DATE(CONCAT_WS('-', gradYear, gradMonth, '01')) < ?
Supplying a parameter of strtotime(date("Y-m-d")
for that placeholder.
If you convert your gradYear
and gradMonth
to a proper DATE
column, this query would look like:
WHERE gradDate < ?
I'm not sure how "Y-F"
as a format ever worked since that produces things like "2013-January"
which isn't going to sort properly, as "April"
would then be the first month of the year ASCII-abetically speaking.