Hi and welcome to YT

.
I would get this little guy to a vet ASAP. To me, it sounds like he could be experiencing both pain and some dementia. Also, when a dog truly stops eating, it's a very tell tale sign that something is definitely wrong. If he's in pain, you need to know why. If dementia, there are meds to be tried for this.