SELECT DISTINCT, n.title, n.newsdate, n.category, (SELECT c.title FROM c2k_2010_category as c WHERE = n.category) as category_title FROM c2k_2010_tag_relations tr INNER JOIN c2k_2010_tags AS t ON = tr.tag_id INNER JOIN c2k_2010_news AS n ON = tr.news_id WHERE tr.news_id <> 0 AND t.tag_name IN ('polo','cortina d'ampezzo') AND n.publish = '1' AND n.newsdate <= CURDATE() AND <> 19945 AND n.draft = '0' ORDER BY n.newsdate DESC LIMIT 3

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ampezzo') AND n.publish = '1' AND n.newsdate <= CURDATE() ' at line 7