Dear friend, as you are having pain while passing stools it is suggestive of "fissure". the main reason is constipation.Pls follow my suggestions.
1) Take warm water in a tub.Add some salt and 15 ml dettol. Sit in the water for 15 mins twice daily.
2) Take a fibre and protein rich diet ( Greens, Egg white, milk, fruits and nuts).
3) pls DO NOT EAT NON VEG
4) Take the following medication for 5 days
a) Tab. Augmentin 625 mg 1-1-1
b) Tab.Pan 40(before food) 1-0-1
c) Cap.Bifilac 1-1-1
d) Diltigesic gel for L/A
pls show this to a pharmacist He will guide you.
If you still have the symptoms after following all this regularly pls consult a general surgeon near you.
hope this helps.regards.