Hi Ajay
Welcome to NeuroTalk

.
This thread discusses a link between Cephalexin and PN
Cephalexin .
Maybe the bacteria responsible for your UTI are resistant to the cephalosporin class of antibiotics.
Discussing trying an antibiotic from another class with your doctor might help.
All the best.