Midol

so today we had testing for 3 and a half hours and I was cramping the whole time but we're not allowed to have medication unless it's in the nurses office but I keep mine in my backpack. anyways after testing I took two midol and was still cramping after lunch so I took four more... and now I feel nauseous and dizzy, do you think it's because I took six pills in less than two hours?