First of all stop masturbating for now. You must have contracted UTI and having symptoms for the same. You need to start on following medications.
1. Tab. Levomac 500 one tab once a day
2. Tab Zerodol-SP Tab 2 times a day
3. Tag pantop-d does once daily empty stomach
4. Tab. Stiplon (Himalaya) 1 tab 2 time a day for 5 days
5. Cap Vizilac 1 cap daily
Continue all the medicines for 5 days and then report. After 5 days medicines are to be continued father for 10 more days but the doses have to be reduced.
Next Steps
if problem persists even after 10 days consult urologist
Health Tips
drink lots of water and Cranberry juice, avoid spicy and non veg diet. eat green leafy vegetables.