Sounds like a kidney or bladder infection, are you still having this problem, if so, please see a doctor, you don't want it to get too out of hand.
It could be a Bladder infection so go to the Doctor and ask him, they will take a sample of urine and it should show if there is any infection, he will them treat you with anti biotics Good Luck