I have the following query
SELECT * FROM usuarios
WHERE NOT EXISTS (SELECT * FROM pagos
WHERE pagos.id = usuarios.id AND mes =< '$mes' AND ano =< '$year' )
I am trying to show or select the users who have not made payments in a range not greater than a month, I can show that the year is different but I can not show it if the month is different, that I may be doing wrong.