Babies Stool... Help please!

Starr • Mother of a baby boy, married to his daddy.
My son is only 2 weeks and 4 days old, the past couple of days his stool has been solid. We went to the doctor a few days ago and told the doctor that my son has been constipated. And he told me to get mom (milk of magnesia) and give him a half of a tablespoon 2-3 times a day. I've been doing that and now his stool is solid and my poor baby boy is hurting trying to poop. I've tried water, mom, and gas drops nothing is working. Does anyone know what I can give him to help soften his stool?!