honesty with doctors

M
So I've been having some burning when I pee if it hits a certain spot on my vagina and I've had sex before. Today I was at the doctor and he asked if I was sexually involved and I told him no was that wrong and should I have been honest with him