Yeast infection when I don't have sex?

I had been having sex everyday, lucky me, for about a week and a half ,but a day after I didn't, I got the worst yeast infection !! Why!!