Welcome to JA and thanks for asking
There are a few possibilities here
The pain can be due to adhesions/scars from the previous surgery.
Stool immediately after the meals indicate a hyperactive bowel causing gastrocolic reflex and thus the stool.
IBS is another possibility
You can take some PPI like omeprazole and some antacid to help with bloating and flatulence.Ispaghula husk also help in regularizing the bowel.
In the meanwhile make an appointment with your doctor and get some lab work and if indicated an ultrasound and CT abdomen as well.After examining your doctor can guide you further investigations.
Feel free to ask if any more question
If done Please leave a POSITIVE (3 – 5 stars, preferably 5) rating by clicking on the stars above, until you do I am not compensated for my time. You can continue to ask follow-up questions even after the POSITIVE rating
Are you with me?
Do ask if any more question
You are most welcome
Due to previous surgery there can be scars inside the abdominal cavity and these can give rise to pain.
I would suggest you do get evaluated for your symptoms and get the above mentioned investigations.