Thanks for writing your query.
After reading your post, it seems that you had suffered from Vasovagal attack.
It might have triggered from the stimulus of severe pain
In this the blood pressure becomes low, resulting in decreased supply of blood to the brain leading to fainting
and the other symptoms you have experienced.
Whenever you feel the symptoms of the vasovagal attack, you should lie down with head end lower than the feet so that blood reaches the brain faster and you will feel relieved from the symptoms.
You should consult a Physician and get yourself clinically examined.
Also get an ECG and a scan of your head done along with Hemoglobin
levels to rule out ither possible causes of your symptoms.
Also get your blood pressure and pulse rate monitored.
Also get yourself investigated to know the cause of your pain in abdomen and get treatment accordingly. You may take antacid like Omeprazole
20 mg once a day before meals. This will help in relieving pain in abdomen due to increased acidity and gastritis
I hope this is helpful to you.