Hello, this is Dr. Bruce and I would like to help you with your dog.
I'm sorry to hear that he has this problem.
Is he able to walk now?
I would be very suspicious that your dog may have had a seizure. Assuming that he is able to walk now and is acting normal (or close to it(, then what you describe is very consistent with some sort of seizure.
The most common cause of seizures in dogs is epilepsy which is very treatable.
I would recommend taking him to see the vet tomorrow and get evaluated. It may be necessary to have some blood tests run to rule out any other issues.
If epilepsy is diagnosed, then it is likely that he will need to be put on an anticonvulsant medication.
If he is still not walking or able to move normally at this time, then he needs to be seen immediately by a vet. A urinary tract infection should not keep him from being able to get up normally.
I hope this helps and that he is feeling better very soon. If you would like to continue this chat, please reply to this post and I will get back to you as soon as possible.