Error: 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 '))' at line 18
SELECT evdays.eventid, evdays.eventid as evdaysid, evdays.id, ev.name, ev.description, ev.openair, ev.organizer as orgid, cat.name as category, cat.id as categoryid, loc.name as location, loc.id as locationid, geoloc.ort, loc.zip, loc.address, loc.city, evdays.start, evdays.end, evdays.canceled, ev.image, ev.video, ev.download, tictype.type as tictype, tictype.status as ticstatus, tictype.soldout as ticsoldout, tictype.saalplan as ticsaalplan, tictype.versand as ticversand, ev.web_ticket, IF(TO_DAYS(NOW())-TO_DAYS(ev.addtime) < 15,1,0) as new, CASE WHEN ((`gs_vorab`+`gs_lastschrift`+`gs_paypal`+`gs_su`) > -4) THEN 'ft' WHEN ((`gs_vorab`+`gs_lastschrift`+`gs_paypal`+`gs_su`) = -4 AND `gs_extern` != '') THEN 'extern' ELSE '' END AS `voucher` FROM ft_event_days evdays JOIN ft_events ev ON (evdays.id=ev.id) LEFT JOIN ft_locations loc ON (ev.location=loc.id) LEFT JOIN geodb_locations geoloc ON (loc.geolocation = geoloc.id) LEFT JOIN ft_categories cat ON (ev.category = cat.id) LEFT JOIN ft_ticket_type tictype ON (evdays.eventid = tictype.eid) LEFT JOIN ft_organizers org ON (ev.organizer = org.id) WHERE (evdays.eventid IN ())