Phone isn't detected via USB but still charges
A USB connector has two pins for 5V and two for the data signal. Seems like the first are still connected while the latter are not.


Have you tried another cable and restarted your PC?
It's also possible that the phone's socket is damaged or has connectiviy problems.
It's soldered onto the phone's logic board. Did you once drop it with the cable inserted?