and kidney stone can cause pain
on flank. However UTI is usually associated with burning sensation in urine and is more common in females.
I would suggest you to get an Ultrasound
KUB done and a Urine routine/microscopy done that will help us to make conclusive diagnosis.
For now you can take Tab. Drotin
A twice a day for pain
And Syp. Alkasol
2 tsf twice a day (in a glass of water)