Hello,
Sometimes, stds can stay in the body and cause problems a long time after getting into our bodies. Sometimes, they cause lesions (that's the reason why you feel pain) and even if they are treated, there can be a secondary infections, with fungi or any other parasite.
If you got chlamydia or gonorrhea, take the treatment until your doctor tells you to stop. 3 weeks after finishing the treatment, test for this two infections. If your result is negative, you are free, but you will have to look for a treatment for your secondary infections.
f it's a yeast (fungi) infection, it will be treated easily with a cream.
All the best.