I guess your phone may have been jailbroken?
Two situations:
First: The music format is wrong, and the music imported from the iPhone needs to be in aac format
Second: It is very likely that there is a problem with your data cable .
There is also a situation that will occur if you jailbreak. It's just that the music on the iPhone cannot be opened. It is caused by a certain plug-in.
The last suggestion is to try flashing your phone again