Which one are they the same

Macrobid or keflex for uti? I’m so confused they gave me keflex at the urgent care but my doctor recommended macrobid