Yesst infection won't go away!!

so i've had a yeast infection for a few days now. I tried monistat & that didn't work. so i went to the doctor, she gave me two pills and that STILL didn't work! i don't understand why this is happening or why i got a yeast infection in the first place. :( i'm so itchy and burny i want to cry