SELECT codgart,nameart FROM aagadmin_articles WHERE estado='publicado' && id = (SELECT MIN(id) FROM aagadmin_articles where id > ) OR id = (SELECT MAX(id) FROM aagadmin_articles where id < )