Maybe it’s a uti?

So I went to the doctor 2 days ago and I ask him if he know if I have a uti or not and he’s like yea it would tell us when you did your urine sample I was like oh ok and I just went to the bathroom and it hurts to pee like he would’ve told me I had a uti or can dehydration make it hurt to pee? I don’t know, I think I do have a uti.