Had it been examined by a surgeon? It is only after clinical examination that one can be sure of what exactly it is. It can be due to tear in side wall of anus resulting from constipation
Take plenty of water to get relieved from constipation. Avoid spicy food. If needed you can take any laxatives (Stool softners).