Thank you for your query,
I advise you not to use medication without a doctor prescription.
There are many reasons for cough like allergy, throat infection
and some times ear irritation
Examination of the child is important to decide the type of cough and to know the status of the lungs to prescribe the type of cough syrup.
So consult the Pediatrician
, get your child examined and take proper medication advise.
Hope I have answered your query.