vizay, this is a serious problem and your dog MUST see a veterinarian. There isn't anything that you can do at home to help him. Please get him in to a vet today if possible. He could be in a great deal of pain. Dogs are very stoic about pain and tend to keep it to themselves, so don't assume he isn't hurting if he's not whining.
I totally agree, your dog needs to be seen by the vet. If he is old, he may be losing muscle mass which will make it hard for him to walk. If he is younger, he may have hurt his back. Take him to the vet.