Sex hurts

Does it always hurt when u have sex when u have a yeasts infection or a bladder infection