This is a really bizarre problem. I'm using a MacBook Pro running Mountain Lion and an iPhone 4S, both with the latest updates. I'm using the bundled Apple cord. When I plug it into the wall charger, it charges fine. But when I plug it into my MacBook to sync, it will frequently disconnect (sometimes as many as ten times in as many seconds). I jiggle the cord on both ends, plug it into the other USB port, and even cleaned out the inside of the phone. Also, when I use the USB ports for my external keyboard and mouse, everything works fine.
Does anyone have any suggestions?