My iphone 4 had the same problem. It says that it is connected and it can transfer data but it doesnt charge. I had the battery replaced and therefore I was able to retrieve photos etc which is good. Even when it is attached to the wall socket it doesnt do anything. I think it must be the dock socket. Ill replace that and see if that fixes it.