DS got an erection today and went hysterical. he was crying and upset, telling me "my doodle hurts mummy" and "make it go away"

I have no idea what is going on, but mum said that it happened on the weekend when he was at her place as well.

I do know that his foreskin is unlikely to be tight - when I took him to the GP once cos i thought he might have a UTI (he didn't) they commented that it was quite loose.

Is there another reason it might hurt?
Is it possible that he's just scared cos he doesn't know what's happening?