I just had this problem you can go to CVS and get asprin that is 80 mg for your dog what this does is numb the pain for your dog and then he can get up... Your dog might have arthritis
The very first thing I would do is get the dog to the vet immediately ! To get him in I would get the dog into a crate and get someone strong to get him to the car then drive fast to the VET!!!!