Spicy food cannot cause ankylosing spondylitis. That is a specific joint condition needing proper tests before the label applies. Your stiff neck is most likely muscular and separate from the loose motions.
Next Steps
A gastroenterologist visit with a stool test will get to the bottom of digestion that stays upset for months.
Health Tips
A warm compress and gentle movement should ease your neck within a few days.