If the pain comes when you’re peeing I can think of two potential causes for your pain, a urinary tract infection, or a kidney stone. In both cases you should visit a doctor immediately. A bladder infection will not easily go away on its own, you’ll need antibiotics, and a kidney stone will put you in excruciating pain until you pass it, you’ll want some pain killers for that.
Which side hurts can provide you some information as well. You have a kidney on either side of you just under the rib cage. Your appendix is on your lower right side, and your bladder is on your lower left side. Where the pain is coming from is a good way of determining what exactly is wrong, although I would still leave that for your doctor to decide.
There is of course the odd chance that your appendix is inflamed, in which case I strongly suggest you see a doctor ASAP. IF your appendix were to burst it would be too late to bother calling a doctor.
Some general advice, if any pain brings you to your knees for more than a few moments, it’s time to visit your doctor.
You can use this site to navigate human anatomy. Have fun!
http://www.innerbody.com/htm/body.html