AZO yeast pill

I’ve been put on an antibiotic and now I’m getting a yeast infection the doctor told me over the counter monstat so assumed the pill would be ok!?