Good quantity of water, and fruits (raw). Give probiotics for 15-20 days atleast. Think about some food allergy
, if you can point out some food which is consumed in recent past of having such episodes, try stoping that and see.
Still constipated, need to have proper history and then accordingly treatment.
In case above all trials have been done, please come on personal chat, shall talk about it.