See a pd to confirm the condition and medicine will help to treat fast. Usually some antibiotics will solve the issue. Cranberries juice is more of preventive in my opinion and definitely given sufficient water is the best option. I know boys tend to get it easier than girls from what I read and the way cleaning is done after pee and poop will also help to prevent the infection. Girls: from front to back. Boys: wash with water and wipe dry after each pee.
i didnt know a young kid can get uti. that is very serious. you should go to the doctor immediately. practice washing off the pee, and not just wiping off with toilet roll. i hope he recovers ASAP. God Bless. meanwhile drink cranberry juice.