Honestly, I think it really depends on the vegetable. Make sure to feed him vegetable which are high in vitamin C (due to guinea pigs not being able to produce vitamin C themselves) such as cabbage, salad peppers, spinach and broccoli. However, it's a good idea to slowly introduce these things if he's never had them before and keep an eye on his feces to makes sure it doesn't disagree with his stomach.
Other vegetables, such as carrots, are high in natural sugars. They are good for guinea pigs but shouldn't be given them too much because the sugar levels can disagree with him (which is probably what has happened to your guinea pig).
They should be offered vegetables high in nutrients daily to make sure they don't suffer from a deficiency, yet the vegetables high in sugars should be given less excessively.
I'd also suggest you make sure your guinea pig hasn't got diarrhea, which can be serious in them. If it's somewhat watery, don't panic. This is not a severe case and you can give him your own treatment. If this is the case, feed him lots of hay, refrain from giving vegetables and increase his water intake. But also take him to a vet to have a check up and explain what has been happening with his feces. The vet may offer antibiotics but you should never give him antibiotics that haven't been prescribed by the vet.
Hope this helps
