Welcome to Healthcare Magic
You are probably having a bowel infection. Have you noticed any blood in the stools. It would be best to go to ER and get your stool tested for infection. Also get examined for anal fissure
or similar pathology which can cause burning besides the acidic nature of the stools which can also irritate the anus causing burning. Drink plenty of water. Keep hydrated. Eat well washed fresh fruits and vegetables.