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 ') OR (date = AND id > ))
ORDER BY date DESC, id DESC
...' at line 6 ... query:
SELECT *
FROM moduleNewsitem
WHERE website_id = 31
AND language_id = 1
AND active = 1
AND ((date > ) OR (date = AND id > ))
ORDER BY date DESC, id DESC
LIMIT 1