SELECT 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 oglo24_announcement AS ogl LEFT JOIN oglo24_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-19' OR ogl.forever = 'TRUE' ORDER BY ogl.id > DESC, ogl.id ASC Caught exception: 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 1 array(3) { [0]=> array(7) { ["file"]=> string(73) "/home/platne/serwer257042/public_html/infopisz.pl/classes/mysql.class.php" ["line"]=> int(105) ["function"]=> string(7) "doQuery" ["class"]=> string(5) "MySQL" ["object"]=> object(Announcement)#19 (14) { ["value"]=> array(0) { } ["query"]=> object(mysqli_result)#20 (5) { ["current_field"]=> int(0) ["field_count"]=> int(43) ["lengths"]=> NULL ["num_rows"]=> int(0) ["type"]=> int(0) } ["row"]=> NULL ["logs"]=> bool(false) ["perpage"]=> NULL ["sqlTable"]=> NULL ["sqlWhere"]=> NULL ["sqlOrder"]=> NULL ["sqlFullQuery"]=> NULL ["thumbWidth"]=> int(110) ["thumbHeight"]=> int(97) ["fieldWidth"]=> array(12) { [1]=> string(2) "8%" [2]=> string(3) "17%" [3]=> string(3) "25%" [4]=> string(3) "33%" [5]=> string(3) "42%" [6]=> string(3) "50%" [7]=> string(3) "58%" [8]=> string(3) "67%" [9]=> string(3) "75%" [10]=> string(3) "83%" [11]=> string(3) "92%" [12]=> string(4) "100%" } ["false"]=> bool(false) ["now"]=> string(10) "2024-03-19" } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(440) "SELECT 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 oglo24_announcement AS ogl LEFT JOIN oglo24_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-19' OR ogl.forever = 'TRUE' ORDER BY ogl.id > DESC, ogl.id ASC" } } [1]=> array(7) { ["file"]=> string(93) "/home/platne/serwer257042/public_html/infopisz.pl/modules/announcement/announcement.class.php" ["line"]=> int(2646) ["function"]=> string(8) "sqlQuery" ["class"]=> string(5) "MySQL" ["object"]=> object(Announcement)#19 (14) { ["value"]=> array(0) { } ["query"]=> object(mysqli_result)#20 (5) { ["current_field"]=> int(0) ["field_count"]=> int(43) ["lengths"]=> NULL ["num_rows"]=> int(0) ["type"]=> int(0) } ["row"]=> NULL ["logs"]=> bool(false) ["perpage"]=> NULL ["sqlTable"]=> NULL ["sqlWhere"]=> NULL ["sqlOrder"]=> NULL ["sqlFullQuery"]=> NULL ["thumbWidth"]=> int(110) ["thumbHeight"]=> int(97) ["fieldWidth"]=> array(12) { [1]=> string(2) "8%" [2]=> string(3) "17%" [3]=> string(3) "25%" [4]=> string(3) "33%" [5]=> string(3) "42%" [6]=> string(3) "50%" [7]=> string(3) "58%" [8]=> string(3) "67%" [9]=> string(3) "75%" [10]=> string(3) "83%" [11]=> string(3) "92%" [12]=> string(4) "100%" } ["false"]=> bool(false) ["now"]=> string(10) "2024-03-19" } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(440) "SELECT 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 oglo24_announcement AS ogl LEFT JOIN oglo24_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-19' OR ogl.forever = 'TRUE' ORDER BY ogl.id > DESC, ogl.id ASC" } } [2]=> array(7) { ["file"]=> string(87) "/home/platne/serwer257042/public_html/infopisz.pl/modules/announcement/announcement.php" ["line"]=> int(500) ["function"]=> string(23) "getNextAnnouncementById" ["class"]=> string(12) "Announcement" ["object"]=> object(Announcement)#19 (14) { ["value"]=> array(0) { } ["query"]=> object(mysqli_result)#20 (5) { ["current_field"]=> int(0) ["field_count"]=> int(43) ["lengths"]=> NULL ["num_rows"]=> int(0) ["type"]=> int(0) } ["row"]=> NULL ["logs"]=> bool(false) ["perpage"]=> NULL ["sqlTable"]=> NULL ["sqlWhere"]=> NULL ["sqlOrder"]=> NULL ["sqlFullQuery"]=> NULL ["thumbWidth"]=> int(110) ["thumbHeight"]=> int(97) ["fieldWidth"]=> array(12) { [1]=> string(2) "8%" [2]=> string(3) "17%" [3]=> string(3) "25%" [4]=> string(3) "33%" [5]=> string(3) "42%" [6]=> string(3) "50%" [7]=> string(3) "58%" [8]=> string(3) "67%" [9]=> string(3) "75%" [10]=> string(3) "83%" [11]=> string(3) "92%" [12]=> string(4) "100%" } ["false"]=> bool(false) ["now"]=> string(10) "2024-03-19" } ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(4) "1624" } } }