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 't(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])say(^| |$|[,])' OR keywords REGEX' at line 1 SELECT id, idEvent FROM events_items WHERE active=1 AND (keywords REGEXP '(^| |$|[,])Oops(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])don't(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])say(^| |$|[,])' OR keywords REGEXP '(^| |$|[,])goodbye(^| |$|[,])') AND dateStart > 1338391882 ORDER BY events_items.dateStart