Banners::getBannerByRandom ::: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') WHERE Banner.place_id=135 AND Banner.publish='yes' AND Banner.date_start<=NOW' at line 1 ::: SELECT DISTINCT Banner.id, Banner.html, Banner.type_id from Banner INNER JOIN RefBannerRegion ON RefBannerRegion.banner_id=Banner.id AND (RefBannerRegion.region_id=11 OR RefBannerRegion.region_id=5) INNER JOIN RefBannerTheme ON RefBannerTheme.banner_id=Banner.id AND RefBannerTheme.theme_id IN () WHERE Banner.place_id=135 AND Banner.publish='yes' AND Banner.date_start<=NOW() AND Banner.date_end>=NOW() ORDER BY id DESC LIMIT 1