Onion intolerance... now garlic too?

So around 4 years ago I randomly developed an onion intolerance. My stomach bloats and hurts and sometimes I feel sick and get gassy. I've pretty much cut all types of onions out of my diet however now I'm getting the same reaction when I'm eating some type of other food. I'm guessing it's garlic since onions and garlic are in the same food family and I got a stomach ache after eating garlic green beans once. This makes eating out so difficult cause sometimes I just end up crazy bloated after I eat and I don't know if it's because garlic was used to season the food. Anyone have any insight?