Welcome to healthcare magic
Your daughters constipation
may be hereditary or nutritional i.e due to inadequate intake of fibre and water.Sometimes it is normally seen in infants and toddlers due to tight musculature of anus but if that is the case you neednot worry as it resolves gradually as age advances.
Your doctor has given apropriate treatment and advice.Only thing I would advice is try to avoid any iron containing tonics if you have been using one .Also find out if she has developed a fear due to pain associated with potty time .Dont worry and dont stress
the child, soon all will be fine.