Re: kidney stones or infection?
Unfortunately any of those issues could be the cause of your pain. It could be that you have multiple issues going on, which obviously would make it difficult to pinpoint the cause of your pain. The easiest way would be to go to a doctor where it would be likely he would preform two initial tests: urinalysis (to check for infection, signs of blood, or kidney stones) and a plain xray (some stones are visible on xray, and xray admits much less radiation than a ct scan or could also show constipation which could be causing your pain). If either test give him reason to think a ct scan would be beneficial, you would then probably go for a ct scan which would show kidney stones or ovarian cysts.
I was first diagnosed with kidney stones in a similar circumstance as you. I began showing signs of a UTI (feeling like I had to pee and then not being able to) and was diagnosed with a kidney infection. A few days later the pain was so intense I ended up in the ER where a CT scan was done, showing stones on both sides. I later found out when examining the CT scan report I infact did have ovarian cysts at that time as well and showed signs of one recently rupturing (which could cause pain but usually much lower in the abdomen rather than the flank). In addition I have Inflammatory Bowel Disease so I was told my pain could also be intestinal related. After several procedures on my kidneys I am confident my flank pain (pain in the back a little below the rib cage) was kidney related. I just recently had two ureteroscopies last week which showed an obstruction in each ureter...which was causing urine to back up which was then causing my pain. It is not the kidney stone itself that causes pain, its when the stone (usually once it goes in the ureter) blocks the urine flow causing the urine to back up, which then causes the pain. In my case, my blocked ureter was causing the pain not my kidney stones as they were still in my kidneys. With that said, an infection can equally cause pain. Thats why it is important to go in for a basic urinalysis to check. I wish you luck and I definetly can understand your worries.