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 ') ) AND (showfrom<='2012-05-17' OR showfrom='0000-00-00') AND (showuntil>='20' at line 1
SELECT DISTINCT Content.ID AS ID FROM Content WHERE (Content.ID IN ( SELECT Contenttag.CID AS ID FROM Contenttag INNER JOIN Tag ON Tag.ID=Contenttag.TID WHERE ) ) AND (showfrom<='2012-05-17' OR showfrom='0000-00-00') AND (showuntil>='2012-05-17' OR showuntil='0000-00-00') ORDER BY showfrom DESC, priority ASC LIMIT 0,20