From history it seems that you might be having acute infection in ear giving rise to painful, enlarge lymph
nodes in the neck causing this problem.
If you are elderly then possibility of having cervical spondilitis is there.
Consult your doctor and go for one antibiotic and anti-inflammatory medicine course.
If he advises, go for x-ray cervical region.
Ok and take care.