Speak to your local pharmacist- there may be an over the counter diarrhoea medication that she can take and perhaps, get some incontinence pads to prevent any possible accidents. They might not be a nice thing to contemplate wearing- especially at 9 years old- but they're discrete and will save your daughter embarrasment.
I've heard of girls starting at 8 too & tbh, most people don't realise that puberty for girls & boys starts at around 7-8 years old. It usually starts off very slowly with subtle changes in hormone levels. The hormonal changes then peak at around 10-11 and remain in heightened state for a few years (thus, rapid changes start taking place), before starting to lower & stabilise.
As your daughter is quite young, you may find that she has a hiatus. In other words, when she's about 11-12, her hormonal changes will start to slow down.
At the moment though- it may be that she'd find some comfort from a contraceptive pill/injection. Again- it's not a nice prospect for an innocent 9year old to be stuck using something that is associated with being old and not nice for a parent to have their young child on a medication associated with sex & preventing pregnancy.
Yet the contraceptive pill will give you & her more control over when her periods happen & could help immensly with her pain & unexpected bowel movements.
My best wishes to you & your daughter & I very much hope she finds relief soon.
Oh, sorry- forgot.
Her bowel movements sound like hormone related IBS (irritable bowel syndrome). This is very common. Hormonal changes can effect all sorts- appertite, mood, digestion, etc. Hormone related IBS does stabilise once someone is using a hormonal contraception; however, IBS can also be a symptom of stress (due to levels of hydrocortisone in the blood stream).
There isn't much else you can do for IBS, except take over the counter medication. Your daughter might also be able to recieve a medical card which says she is allowed to use private toilet areas (i.e; staff toilets in shops, etc), in case of accidents when out.
Again- Best wishes.