Check the mute switch on the side of the phone above the volume buttons & make sure it's not turned on. If it's on turn it off & your sound should work.
This was a popular problem on the older iPhones with the old charging ports. The thing would get stuck in dock mode and the sound wouldn't play. Might be something to look into.