DS is not necessarily "older" but I think of it that way because he was fully potty trained for the better part of a year before the trouble started. His BMs started to get further and further apart. He went from every day to every other day, then longer. The first time he hit 4 days I took him to the doctor. He was prescribed Miralax to kind of "reset" his system. They had this theory that he held the poop when he was playing or something, and that made it uncomfortable when he did go, which made him resist going the next time and set up an ongoing spiral. Miralax cleared him out, it also made him have nasty, unexpected diarrhea messes, was a nightmare. But after two weeks I weaned him off, and he went right back to 4 and even 5 days between. He had encopresis so bad once he was squeezing out little marble sized bits 20 times a day. We had a full set of labs and stool samples come back clean. They have labelled him IBS (irritable bowel syndrome) but haven't done any internal testing.
I started tinkering with his diet and after a year we have something that keeps it from being really bad (he's gotten to where he's thrown up after eating because there's just no room in his abdomen). No white starches, limited grains, as much fruits and veggies as he wants (and soluble fiber in his drinks if there's a day that seems short), and what seems to work better than anything: Kefir. It doesn't make him "regular" but he goes more regularly and softer if he drinks 2 cups a day, sometimes he'll even go 5 times in a week.
I have to keep track on a calendar though. If he gets to day three I will use a glycerin suppository, especially if he complains of abdominal pain. If that doesn't work, I give him a half dose of Miralax each day until he goes. I'm just glad we've gone from weekly to monthly on that because even on the half dose it causes him to have diarrhea.