I am so sorry that your guy is not feeling well. What is his name, age and breed? It appears that he is suffering from a digestive disturbance caused possibly by something odd he may have ingested. Most often, this treatment that follows will help him past this:
Fast him for 12-24 hrs to allow the digestive tract to calm down and heal. If this has been over 24 hrs of a fast, then feed him a small meal of rice and boiled chicken.
Give him Pepcid AC or Famotidine at 0.5 mg per pound every 8 hrs. This can be purchased over the counter at the human pharmacy or chemist.
Give only small amounts of water during the fast or ice cubes
After the fast, feed the rice and boiled chicken (2/1)
If the symptoms have resolved, then wean him back onto regular food. If the they persist, especially during the fast, take your guy to your vet for an exam and lab work to determine the cause for this. This is extremely important since this can cause dehydration or other more serious concerns such as an intestinal obstruction or infection that will require veterinary intervention.
Does that make sense to you?