You might also cough up thick, yellow or green mucus. These symptoms may also occur with a cold. But if they last for more than a week or are severe, you may have a bacterial infection and need antibiotics. Only your doctor can prescribe antibiotics.