As GrahamS says, it’s surprising how much fluff collects in the dock, and pushing the cable in compacts it, too. Get a darning needle and carefully run it around the bottom of the dock port, you may find a lump of stuff that’s stopping the connector seating properly. I still use my old iP4, as an iPod, and for car navigation, and I noticed the cable wouldn’t seat properly, found a large lump of stuff at one end.
Connected up perfectly once I hooked it out. FWIW, I’ve got about half a dozen cables, from different sources, and they all work just fine.