Breastfeeding woes

Jacklyn
So me and my lil one was doing so well until I got thrush in my breast... Now I feel so discouraged because my doctor put me on medication this is my second round and it's still really painful like I'm in tears everytime I feed my child. I'm soooo stressed about the whole thing I really don't want to give up but idk if I can take this pain any longer !!! I feel so selfish but I think it's starting to bother my child also.... I'm really leaning towards to formula feeding I'm kinda emotional about it because I love the bond me and my son had before all the pain but I was told the pain could take a long time to go away ... Both of us are aggravated... Should I give up ? The only thing stopping me is I feel selfish I'm not giving him the best thing he needs ..... I'm so stressed where I'm crying .... I need some words of encouragement or some advice ... 
Help!!