Your abdominal muscles seem to have been inflamed. You must have done your abdominal exercise by lying flat on the floor and raising your head and legs simultaneously in the air. I suggest -
1. Take rest till the symptoms subside.
2. Apply local heat.
3. Try this exercise for strengthening your abdominal muscle so that your hip joint is relaxed. Do half sit-ups slowly with bent knees.
4. If your back is also hurting you, apply local heat at the back too.
5. Try and maintain a good posture while sitting, standing and lying down.