Consulta: SELECT a.*, c.nombre AS categoria, l.nombre AS localidad FROM anuncios AS a INNER JOIN categorias AS c ON (a.id = '' AND a.id_categoria = c.id) INNER JOIN localidades AS l ON (l.id = a.id_localidad) ORDER BY a.destacado desc, a.orden ASC, a.fecha_modificacion desc nulls last, a.titulo asc, Error: ERROR: invalid input syntax for integer: "" LINE 1: ...uncios AS a INNER JOIN categorias AS c ON (a.id = '' AND a.i... ^Consulta: SELECT * FROM fotos WHERE id_anuncio = '' ORDER BY principal DESC,titulo ASC, Error: ERROR: invalid input syntax for integer: "" LINE 1: SELECT * FROM fotos WHERE id_anuncio = '' ORDER BY principal... ^ Tukasa -