select *, (select zona from cms_zonas where id_zona = cms_propiedades.id_zona) as zona_texto, (select tipo_es from cms_tipos where id_tipo = cms_propiedades.id_tipo) as tipo_texto from cms_propiedades where estado=0 and visible and id_zona in () ORDER BY RAND() LIMIT 0, 21 - 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 ') ORDER BY RAND() LIMIT 0, 21' at line 1