Condition For Integer Roots

we get the number of values of $a$ as as 6.

I don't think this is correct. For example, $m=16$ works.

Is there any other method where I don't have to check the values of $m$ ?

We have $$a=\frac{-x^2}{x+6}=-x+6-\frac{36}{x+6}$$ Since $a$ has to be an integer, $$\frac{36}{x+6}$$ has to be an integer. So, $x+6$ has to be a divisor of $36$.

Note here that the discriminant is $a^2-24a$, so considering the cases where $a=0$ or $a=24$ gives : for $a=0$, $x=0$, and for $a=24$, $x=-12$.

Now since the number of the divisors of $36$ is $18$, the number of $a$ we want is $$1+1+\frac{18-2}{2}=\color{red}{10}$$