IPhone 3G can detect available Wi-Fi networks but cannot connect.

I recently purchased an iPhone 3g in Craigslist. I try unlocking my iPhone. Afterwards, I tried to connect in Wi-Fi. I have typed the wrong password a few times before I realized that it was not what I had set. However, my iPhone would not connect now to any available open networks. I tried connecting with my other iPhone and it has connected successfully. It seems like the problem is with my new iPhone.
I tried almost everything to fix the problem. I reset the network settings, toggled the airplane mode, turned the Wi-Fi on and off, even resetting the new iPhone a few times; but none of these worked.I could not use the system restore since I have set my iPad into baseband.I do not have any idea on how to fix this as of now. I was thinking of replacing the Wi-Fi antenna but I doubt that will work since the antenna is working fine; it can pick up all of the available networks.
Suggestions or advices from someone who knows what to do about this will be of great help. Thanks in advance.
