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 23
SELECT evdays.eventid, evdays.eventid as evdaysid,,, ev.description, ev.openair, ev.publictransport, ev.organizer as orgid, ev.feevvk as vvk, as category, as categoryid, as location, as locationid, geoloc.ort,, loc.address,, evdays.start, DATE_FORMAT(FROM_UNIXTIME(evdays.start),'%d.%m.%Y') AS start_rb, DATE_FORMAT(FROM_UNIXTIME(evdays.start),'%e') AS start_day, DATE_FORMAT(FROM_UNIXTIME(evdays.start),'%b') AS start_month_short, DATE_FORMAT(FROM_UNIXTIME(evdays.start),'%Y') AS start_year, DATE_FORMAT(FROM_UNIXTIME(evdays.start),'%y') AS start_year_short, evdays.end, evdays.canceled, ev.image,,, 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 ( LEFT JOIN ft_locations loc ON ( LEFT JOIN geodb_locations geoloc ON (loc.geolocation = LEFT JOIN ft_categories cat ON (ev.category = LEFT JOIN ft_ticket_type tictype ON (evdays.eventid = tictype.eid) LEFT JOIN ft_organizers org ON (ev.organizer = WHERE (evdays.eventid IN ())