Same thing here. I purchased a new Apple cable from MacMall, got it the next day. Still wouldn't charge the phone. Searching around I found this link: http://thebigboss.org/guides-iphone-ipod-ipad/dfu-mode to reset the phone in DFU (Device Firmware Upgrade) mode. Never saw any action on the phone itself, but the iPhone in iTunes allowed me to Restore From Backup. Sounds scary due to their constant reminders that you'll be losing everything on the phone and have to repurchase all your downloads. Luckily, I'd backed up to the cloud as well as my computer, so I'm pretty sure I'm golden. The restore went without a hitch, I had to go through the complete iPhone setup, but the phone was charging throughout the restore, and EVERYTHING IS THERE!
I don't know if the cable was the problem or not. My wife's phone quit charging last week. Her iPhone5 is three months newer than mine, and that's when I bought two cables, figuring mine would crap out any second. The new cable fixed her problem — FWIW, that old cable wouldn't work on my iPad, either, but the new one does.
Anyway, THIS WORKS! Give it a shot. Be sure to backup to the cloud or your computer first. Naturally, I take no responsibility if the DFU or restore mess up your life completely—I'm just trying to help out!