I've already tried changing the power settings in device manager, but nothing seems to work. It stays connected for a few seconds and then disconnects. Any ideas?
Does device manager show any errors? Try a different USB port on your PC. Try a different PC. Try a different cable. Hopefully you don't have a loose socket on your phone. Not that you want to do this much, but if you wiggle the cable at the socket on your phone, does it reconnect?
I had this same issue went through all the things you are, the fix was simple, because the charging port is in such a great location. I managed to bend the metal part of the cable itself, i bent it back and voila it works great now. Or you could just buy a new charger.