error in "SELECT titel, kurztext, ID, detailtexton, linkdetailurl, linkdetailtext, minipic FROM redaktion_beitrag WHERE (themenID = 2 OR subthemenID = 2 OR subsubID = 2) AND ID != AND startdate <= '2016-08-27' AND enddate > '2016-08-27' AND aktiv = 1 ORDER BY RAND() LIMIT 2":
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 startdate <= '2016-08-27' AND enddate > '2016-08-27' AND aktiv = 1 ORDER BY ' at line 1