I'm just trying not to overlook any possibilities. I'm not implying he has both ear and tooth infections at the same time. He may possibly have one or the other. In either case, the painful areas may overlap. Take a look in his ears. Are they red, painful, smell bad, have discharge? Take a look in his mouth. Are his gums red, swollen, or bleeding? Is there a lot of tartar on the teeth? Are any teeth broken or discolored?
What does he eat right now? I'll try to look up something with totally different ingredients. What pet stores are near you - small specialty, or large chain stores? Are you comfortable feeding fresh raw meat? Would you feed a frozen raw meat diet? Would you only feed dry kibble?
What breed is he? Describe his temperament. Does he eat things he isn't supposed to? What does he get for treats and chew toys? Did anything change in his environment in July? Does he run loose?