From your symptoms of burning anus,
You had infection, therefore had diarrhea with upset stomach. After you had continuous diarrhea, obviously the pressure created during passage of loose stools and flatulence has clearly damaged the lining of rectum and anal canal. During diarrhea apart from undigested food, even the acidic secretions such as gastrin get expelled, when it reaches the rectum further damages the mucosal lining.
What you are facing rite now could be infection of anal region or just after effects of chronic diarrhea. I suggest you wait for 3 to 4 days, if it’s not infection it will disappear by itself. If it doesn’t disappear in 4 days, it could be infection. I suggest you visit a physician to further examine the anal area.