select count(*) as records from (SELECT * from tblti_productos where activo=1 and idcategoria= and idciudad=1 order by idproducto desc) execPage