Earache my eye!
Q: Doug, can I ask an ear question? I have an earache. Sharp intermittent pains. Hurts when I swallow. (and greenish mucus from the nostril on that side, the side with a polyp ... I'll never be able to look you in the face after this revelation. Allergies?
A: Bare minimum, you have a sinus infection on that side. That green yuck coming out of your nose? It's flowing down into your throat, too. On the way down, it passes by your Eustachian tube orifice. Any irritation of the ET orifice will be felt as a pain in the ear. The general term for this is "referred otalgia."
Infection can also ascend via the Eustachian tube, causing an outright ear infection. You don't mention hearing loss, so I'm going to guess you don't actually have an ear infection.
Allergies? Maybe, but that's not the whole story. Allergies won't give you green mucus -- but sinus infection will. You're gonna need an Rx.