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 SINO1=1 AND IDNOTICIA = AND SINO2 = 0 ORDER BY MONEDA1 DESC, IDNOTICIA...' at line 1