Villette's right. Painkillers DO cause constipation. I would recommend calling the vet to ask what they suggest to give for a stool softener. Sometimes it's something as easy as an infant glycerin suppository. But call your vet first!
Another thing, sometimes antibiotics, if he's on any, can cause him not to eat as much, so if food isn't going in, it can't be coming out. hehehe