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 'aime(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])paris(^| |$|[,])') AND dateStar' at line 1 SELECT id, idEvent FROM events_items WHERE active=1 AND (keywords REGEXP '(^| |$|[,])mur(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])berlin(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])mur(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])t'aime(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])paris(^| |$|[,])') AND dateStart > 1338392925 ORDER BY events_items.dateStart