Error en la consulta de conteo alternativo de registros: select * from restaurantes where idportal = 7 and idrestaurante in (select idrestaurante from restcar where idcaracteristico=) and estado like 'cliente%' order by nombre asc. Mysql dijo: 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 estado like 'cliente%' order by nombre asc' at line 1