There was an SQL error: Unknown column 'img' in 'where clause' - SELECt P.*,IF(P.is_english=1,G.nazwa_en,G.nazwa) AS gnazwa,G.order_by , G.home_baner
FROM pp_pages P LEFT JOIN pp_pages_groups G ON P.group_id=G.id
WHERE P.set_on_date<=NOW() AND P.set_off_date>NOW()
AND P.hidden=0 and MONTH(set_on_date) = img and YEAR(set_on_date) = 2006
ORDER BY P.set_on_date DESC