SELECT * FROM patterns WHERE patterns.name like '%jack 'o lantern%' AND (patterns.live=1 OR patterns.live=2) LIMIT 0, 30 failed : 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 'o lantern%' AND (patterns.live=1 OR patterns.live=2) LIMIT 0, 30