He needs to go to the vet to see if there are things that can be done to help him with weight loss and pain management. Supplements, etc, may help. Please don't let them put him on NSAIDs (aspirin, Rimadyl and things like that) without blood work first.
Not going to the bathroom for that long is really dangerous too.
Canine Orthopedic Equipment Designed for Increased Mobility and Extra Support - Whole Dog Journal Article
the Ruffwear harness may be helpful.
DogAware.com Health: Arthritis in Dogs
Adequan for Dogs
Pain in Dogs and Cats: Introduction and Basics Pain in Dogs and Cats: Injuries, Mild Pain, Arthritis, First Aid Pain in Dogs and Cats: Post-Surgery, Severe Pain
Pain and aging can bring on anxiety - less pain can help it.
Cholodin can help as well. Dietary Supplements - MVP Labratories Inc.
But you may want to see if something like Amyltriptiline (Elavil) in low dose, would help. Know that it can cause serotonin syndrome if combined with some other things.
Please call a vet today and get help getting him there if need be.