welcome to HealthcareMagic
I guess you have infection of the urinary tract
and that is probably a sexually transmitted disease
if a white substance comes out it is probably gonorrhoea
.See if you have had sex with any unknown female and got infection through that sexual encounter.Since it is a infection it needs to be treated with antibiotics.Please consult a doctor and get investigated for urine routine and STD
and he will prescribe the necessary antibiotic so get treated soon.