Ear Infection - how long out of the water?

About a month ago I started feeling feverish and dizzy.. the doctor said I had an ear infection and gave me some antibiotics. I was feeling better and started surfing again soon after. Then the symptoms came back. I stayed out of the water for a week and the doctor said my infection was still healing. She said I could surf with ear plugs. I got some doc pro plugs but I think the water was still getting in my ears because soon after I started feeling feverish, dizzy, nauseous again. So I guess my question is.. how long should I actually stay out of the water with an ear infection? It keeps coming back or just won't heal. Has anyone else experienced this?