Bacterial infections?

I went to th doctor because of cramping at 22 weeks, she said I have a yeast infection or a bacterial infection and gave me a cream? This is my 2nd yeast infection, does this happen to anyone else? I feel like the cream is going to make more of an irritation. Also has Antoine had any problems with baby after having bacterial infection ?