If i buy a atnt iphone 4 from amazon can i still use it for t-mobile?

My plan for t-mobile is only unlimited texts and calls, no internet.
I want to buy an iphone 4 from amazon that is atnt, but my current phone is for t-mobile. Can i still unlock it and only have internet were there's Wi-Fi OR do i have to have internet in the plan.
Also, can you give me information of the whole unlocking process, because I don't know the whole details of unlocking an iphone.

Added (1). How much will it cost to unlock?

An AT&T iPhone 4 MUST be unlocked before you can use it on T-Mobile. I know AT&T will unlock a phone free if you've had it with them for a while, but that wouldn't apply here, so I guess you would have to find some other place to unlock it. There are tons of websites that list unlock methods, and places that you can pay to do it, but I don't know which are legit.

Anyway beyond the unlocking issue, remember that the phone you're buying *might* also include a contract with AT&T which you definitely don't want, so be careful (usually phones are a lot cheaper when the contract is part of the deal).

Finally, you *maybe* can get away with not having a data plan - just take the SIM out of your current phone and plug it into the unlocked iPhone and you should be OK (but if the SIM doesn't fit, you'll have to get a replacement smaller one from T-Mobile without changing your plan).

It has to be unlocked before you can use it on T-Mobile.Me and my wife just got our AT&T unlocked on a 2 for 1 special at iPhoneUnlockedCheap.com