I have BTDT with constipation caused by antibiotics (2 weeks at a time cos he kept holding on he was so scared) and the only thing I can recommend is to back right off and wait until he is comfortable pooing while wearing a nappy before even mentioning the toilet.

I second what MantaRay said about sultanas and pears. You can also try prune juice and a gentle softener like parachoc from the chemist. Stay away from laxatives as they can cause stomach cramps which can make his anxiety worse.

Poor little fella