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 'day%') OR LOWER(s.categories_en) LIKE LOWER('%saint patrick's day%')) AND s.base' at line 1 -> SELECT d.id,d.releaseDate,d.coverUrl,d.title,d.pic_lu FROM data_fame.dvds d INNER JOIN data_fame.scenes s ON s.dvdid = d.id WHERE s.releaseDate <= '2024-11-24' AND s.pic_lu=1 AND s.studio = 'Brazzers' AND (LOWER(s.categories_en) LIKE LOWER('%patrick's day%') OR LOWER(s.categories_en) LIKE LOWER('%saint patrick's day%')) AND s.base = 'brazzersnetwork' AND d.base = 'brazzersnetwork' AND d.id != '' ORDER BY rand() LIMIT 0,1