I have been writing all my life, even before electronic media emerged, that
constipation is not a disease but a habit of intestines. If you follow this principle and do accordingly, your medicine requirement for constipation will minimise. On the other hand sometimes you are not able to hold anything down. It will lead to various diseases of digestive system including Crohn's disease,
IBS or
coeliac.
You must address your digestive system and prevent constipation and recurrent infections of intestines and neutrally speaking, nothing is better than Ayurveda in this regard.
First of all modify your diet to the one with rich fibers, less dairy and least glutanates. A lot of water intake, esp warm should be drunk. Take only next major meal when earlier major meal is fully digested, otherwise skip it. Some herbomineral powders and tablets like Lavanbhaskar powder ( easily available in India, elsewhwhere find on net) and Chitrakadi vati flare up appetite and enzyme secretions, maintain digestion ( both constipation and lose motions). Buttermilk may be added to diet. If you can find BAEL powder ( also called Bilv), its choicest for you.
Yet other option is wonderful. BAEL powder, dried ginger powder and Isabgul husk powder may taken 1:1:1 ratio mixed. Take 1 tsp in yogurt or butter milk in morning , afternoon and with warm water in the night.
After a week you will start seeing the changes. May continue upto 4 weeks. If there's some irritation, ginger powder ratio may be reduced.
Hope it helps.