Sex after yeast infection

So recently had bad yeast infection. I went doctor and was prescribed pill and vaginal cream inserts. Two days after I stopped treatment we had sex it hurt so bad. We didn't do anything until last week. It hurt again , so went doctor again said just because dry after a yeast infection it burn because irritated. He ran more test everything came back good. I want have sex again. How long is this supposed last .? I never been dry or had this problem. Is there anything I can do?