How can you tell if your wine is corked -- what if you simply have a sound wine that you don't care for? Even for novices, the smell and taste of a bad cork is pretty unmistakable. If the cork is literally moldy, of course you will see it. But if a swirl and sniff, and taste, of the wine takes you right back to childhood memories of a flooded basement after a summer storm, then chances are you have a corked specimen on your hands. It's the fault of the winery, not the store where you bought the wine.
Most expert wine authors that I have read agree that about 5% of all wines are corked. In about six months of wine tasting through my work, I have probably tasted an average of five wines a week. That works out to about a hundred different wines, and in that time, I have encountered three corked bottles. Statistically, therefore, my experience seems to be almost exactly on target. The ever-present risk of spoliage through bad cork, incidentally, is one of the reasons so many wineries are turning to screw-cap closures for their wines. A screw cap is a perfectly good seal, and it cannot mildew.
And by the way, don't forget that, for the majority of wine bottles sealed with good sound corks, storage on their sides is necessary precisely to keep the wine in contact with the cork. A good cork that is not moistened with its own wine may dry up and shrink, and eventually leak and allow air into the bottle, which will also ruin the wine.