Thanks for your query.Based on symptoms you have stated you have a severe UTi
and needs to undergo following investigations.
1) Routine Urine test
Scanning of abdomen.and scrotum
Please consult some urologist
to assess your problem properly.You need to take antibiotics and urinary antiseptics for UTi and urinary antispasmodics like oxybutinine to control urge.with consumption of 6 to 8 liters ow water in 24 hours.Your erection problems will get cured on improving your urinary symptoms.