class.mysql.php : 1064 - 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 'AND ogl.status = 'ACCEPT' AND ogl.type = '' AND ogl.id <> HAVING pay.pay_exp...' at line 1SELECT ogl.id, ogl.category, ogl.title, ogl.city, ogl.forever, ogl.cost, ogl.cost_notice, ogl.for_free, pay.pay_create, pay.pay_expire FROM komis23_announcement AS ogl LEFT JOIN komis23_announcement_payments as pay ON ogl.ident=pay.pay_ident AND pay.pay_type='VIEW' WHERE ogl.category = AND ogl.status = 'ACCEPT' AND ogl.type = '' AND ogl.id <> HAVING pay.pay_expire>='2024-03-29' OR ogl.forever = 'TRUE' ORDER BY ogl.id > DESC, ogl.id ASC