UTI questions

E

I went to emergency cause I was having bad pelvic pains and always urinating all day everyday..doctor gave me prescription and said it will go away.. the pelvic pain went away but I still have to go to the bathroom a lot and now getting back pains..doctor suggested I drink less water and drink more cranberry juice helps with UTI and kidneys ...why am I still going peeing a lot anyone went throught this before