Why am I have several migraines and the headache medicine isn't working which ends up causes me to the er?

Excellent question! That is indeed a question that needs answering. Any new headaches or a sudden increase in severity of headaches needs to be checked out with your doc. You should see your doctor about this issue right away.