Diarrhea at 20weeks

Was 20 weeks yesterday and woke up feeling very uncomfortable, initially thought it was round ligament pain but started feeling gassy in my stomach. This morning was worse, went to the bathroom 6x in the morning, used some meds and felt a little better till this evening where I felt I was going to burst from the amount of gas in me. Started farting and along the way I started stooling again. This time was so watery. 
Idk if it's something I ate or its normal because this is the first time and it's so painful.
My Doctor says it's risky to be purging during  pregnancy. What should I do????