How long have you had these symptoms? You are suggested to do a stool test first. If colonoscopy does not show any problem, you might have irritable bowel syndrome.
Do you have pancreatitis or chronic liver problems? How long has this been present? It might be IBS (irritable bowel syndrome) for a long time. If these symptoms happened recently, you need to have gastroscopy and colonoscopy. Visit a gastroenterologist.