un foreach scompone chiave - valore...

poi bisogna vedere come e' strutturato il db...