If nothing went into,your stomach, the fasting is valid.
Last Ramadan I visited ENT doctor while fasting (I had a sinus) he inserted a tampon soaked with small amount of medicine into my nostril. Do I have to make up for that day? I might felt the taste of medicine in my throat after some time but I spitted out in order to clean my throat.