If you need to take Rx for pain make sure you take the Rx in the pill bottle to the school nurse or better have your mom call the school nurse to see what the school policy is on Rx. You don't want to be accused of dealing or distribution of drugs! Yes, sillier things have happened!
If you are still experiencing major pains, it is advisable to stay at home and rest. The doctor should let you know of the appropriate time you should rest. However, if you can move freely without trouble, then you can go to school.