There are a few troubleshooting tricks that will solve the problem.
(1) Quit and restart iTunes
(2) Try to connect to a different USB port on the computer
(3) Reboot the iPhone and press the button of Power and Home simultaneously until the icon of Apple appear
(4) Reboot the computer
(5) Use a different syncing cable
If the iTunes still can't recognize the iPhone, probably, the problem is with the iTunes itself. You should delete it and its affiliate software, and reinstall. Here, take Window 7 as an example. Firstly, enter the control panel and follow the following steps to remove the iTunes in order.
Remove iTunes>QuickTime>Apple Software Update>Apple Mobile Device Support>Bonjour>Apple Application Support