Buying a dSLR body "for the future" is the wrong way to think about it. If there is any one peice of gear that "gets old" quickly it is the SLR body.
Lenses are just the other way around. I have some that are 20+ years old that will work well and are as good as those being sold today. No one can say the same for a SLR body.
So if you have some fixed sum of cash to "invest" but the best glass you can afford and then the remainer in a body. In the old days of filmbased photography it did make sense to keep a bopy for 10 years or even 20. But those days are gone. Today your big money is tied up in expnsive glass then every so often you upgrade the body.
Well you do that unless yu are the typical consumer who buys the body with the "kit" lens and then never takes any photos.
So look at your budget and plan out the next few pieces of equipment you want. Only you'd know if you want a macro lens or a short wide angle "fast" zoom or whatever. Then see which body fits. With SLR gear you have to plan ahead and look at the entire "system".
I was also in the same position as you and chose the D3200. I'm very happy with it. If you're just a novice, like me, I guess it doesn't really matter. Although, I will say that after taking some photography classes at my local camera shop, and figuring out what type of photography I want to get into, has given me a whole new outlook on what I want for the future in terms of camera and lenses. Although the 5100 was about $100 cheaper than the D3200, I went with the D3200 because it was released an entire year after the D5100 and the extra megapixels was a plus.