Aside from this forum, I suggest that you Google UTI infections in dogs just to educate yourself.
This is a very complicated issue. UTI can be caused by any number of things.
My pup was spayed at 3-4 months, before I rescued her. This is a real sore spot with me, I've had nothing but females over the past 16 years, prior to the pup, the other dogs were spayed at around 9 months or before first heat. This was very common theory for as long as I can remember. Then all of a sudden I get a dog already done at 3-4 months and red flags went up, but I was assured by the rescue league that things would be fine.
Well, things have gotten very very complicated, especially in the UTI department. My dog has had three of them.
My regular vet and two vets that I consult with, have all come up with a couple of reasons why she keeps getting infected. One reason could be a inverted vulva, which is causing the urine to pool inside, which causes the infection. Another reason could be diet. There are diets made specifically to deal with UTI. Still another reason was hygiene. Because the vulva is inverted, dog cannot properly clean herself, which causes things to build up, which causes the infection. Or it could be a combination of everything.
All of this caused incredible challanges in the potty training department (5-6 months, that's how I learned so much on the subject).
To try and correct all of this mess, three months ago I switched her food to a high quality hypo allergic food (venison and potato), and I clean her twice a day. I have noticed that I am cleaning off substantial dried urine.
I hesitate to say her situation right now, because I don't want to jinx it. Lets just say my vet is happy with the way things are going. I also hesitate to say what needs to be done if things get interesting again.
Good luck!
Anela