UTI or???

I went to the hospital and they diagnosed me with a UTI because I had lower back pain on my right side and it effects the right side of my stomach too sometimes, it doesn’t burn when I pee or have pelvic pain or anything like that so they prescribed Bactrim DS 2 doses twice a day for 7 days and I’m only on my third dose but my back pain is still there I thought it would be getting better by now so is it really a UTI or something worse?