J.
Over the last few years, we have had water in our basement due to foundation cracks several times. With the exception of the first time, we were able to salvage the carpet each time. The key is that you need to get rid of the padding underneath QUICKLY. Pull up the carpet, cut out the padding and put a fan underneath the carpet to dry it out. If it is starting to smell, then yes it is either mildew or mold growing. We worked with a fire and flood restoration company, and the key they told us is to get rid of the padding and get the carpet dry. Replacing the padding is relatively inexpensive, and you can replace only a small section with no problems.