I went to plug in my iPhone to my computer to sync it, but for some reason, my computer stopped recognizing it. It doesn't show up in either iTunes, My Computer, or Device Manager. Yet when I plug it into the wall charger with the same USB cable, it charges, so I don't think it's a problem with the cable or the iPhone (although it has been dropped a few times, so it could be the problem). Sometimes, if I plug it in and leave it for a while, it starts charging, but sometimes stops.
I haven't tried another USB cable yet, and I've tried both USB ports on my laptop (both of which have synced my iPhone in the past).