SELECT SQL_CACHE
e.eventname, MD5(e.event_id) AS event_id, e.country_id,
UNIX_TIMESTAMP(e.startdate) AS startdate,
eventtype,
e.town, c.country, s.sector
FROM event e
LEFT JOIN country c ON c.country_id = e.country_id
LEFT JOIN sector s ON s.sector_id = e.sector_id
WHERE e.eventtype = [t]
AND approved = 1
AND deleted = 0
AND (e.startdate >= CURDATE()
OR (e.startdate <= CURDATE() AND e.enddate >= CURDATE()))
ORDER BY country, startdate, sectorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[t]
AND approved = 1
AND deleted = 0
AND (e.startdate ' at line 9