Iphone 4 USB cable wire can be charging your phone but will not be detected by iTunes or Windows Explorer because of the following reasons.
1.
Your Iphone 4 USB cable wire might be the cause why your phone is not detected by iTunes or Windows Explorer and solution is to buy a new Iphone 4 USB wire and replace the old one that doesn't work well and if the problem persist then follow this steps below:
As i said this problem is often from the USB Cable but in a case where changing new USB cable failed to solve the problem then the next thing is to try tweaking your computer (windows) by following these steps below:
Solution:1. uninstall apple application support, apple mobile device support, apple software update, bonjour and everything related to apple.
2. run command and type regedit and go to HKEY_LOCAL_MACHINE/SOFTWARE/
remove Apple key.
3. Same other location go to HKEY_CURRENT_USER/SOFTWARE/
remove Apple keys.
4. now restart pc and install new version of itunes
Check and see if the problem is solved.