You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND precio BETWEEN 1000 AND 1800' at line 1SELECT count(*) as cantidad FROM articulos WHERE idarticulo in () AND precio BETWEEN 1000 AND 1800