Roots and divisibility for real polynomials of several variables For polynomials over the field $\mathbb K=\mathbb C$ the follwing theorem holds:

Theorem. If $p(x_1,...,x_n), q(x_1,...,x_n)\in \mathbb K[x_1,...,x_n]$ are polynomials such that $p(x_1,...,x_n)$ is irreducible and for all $a_1,...,a_n \in K:$
  $$
p(a_1,...,a_n)=0 \Rightarrow q(a_1,...,a_n)=0, 
$$
  then $p(x_1,...,x_n) | q(x_1,...,x_n)$.

This theorem is not true for polynomials over $\mathbb K=\mathbb R$. For example it is not true for $p(x_1,x_2)=x_1^2+x_2^2$, $q(x_1,x_2)=x_1$.
Is a version of this theorem, with additional assumptions, for polynomials over $\mathbb R$?
Is it  maybe true with additional assumption about $p$ that
(*) "there exists a $y=(y_1,...y_n)\in \mathbb R^n$ such that $p(y)=0,  grad f(y)\neq 0$"
sufficient?    
If not, is it true with additional assumptions (*) and
(**) $p$ is of degree $2$ and $q$ of degree $\leq 2$ ?
I'm mainly interested in the last case.
Thanks 
 A: (*) is sufficient.
$p$ must be irreducible over $\mathbb C$: the only way it can ramify is as $p=PP^*$ for some $P$ with complex conjugate $P^*,$ but then the real points of $p$ would all be singular.
The non-singularity at a real point guarantees that there is a real dimension $n-1$ real algebraic set of real points where $p=q=0.$ The complex dimension of complex points of $p=q=0$ is therefore at least $n-1.$ Since $p$ is irreducible over $\mathbb C,$ this implies $p$ divides $q.$

A standard reference for facts about real algebraic sets is "Real Algebraic Geometry" by Bochnak, Coste, Roy. Unforunately I don't have easy access to it, so can't cite any particular theorem. In the language of real algebra it might be more natural to check that $(p)$ is a prime "real ideal" - that would avoid mentioning complex dimension. But here is the argument I had in mind.
Let $S$ be the set of real points where $p$ vanishes and $\nabla p$ doesn't. The ideal of complex polynomials vanishing on $S$ defines an algebraic variety $Y.$ Now apply Hartshorne Algebraic Geometry Theorem 5.3: the set $\operatorname{Sing}Y$ of singular points of $Y$ is a proper [Zariski-]closed subset of $Y.$ Since $S$ is Zariski dense in $Y,$ there is a non-singular point (see Hartshorne for the definition) $x$ of $Y$ in $S.$ Since $x$ is non-singular in $Y,$ the tangent space of $Y$ at $x$ is well-defined and equals the dimension of $Y$ (this follows immediately from the definition of a non-singular point). Since $\nabla p(x)\neq 0,$ by the implicit function theorem this tangent space must contain $n-1$ real vectors independent over $\mathbb R,$ and is hence of dimension at least $n-1$ as a complex vector space. $Y$ has dimension at least $n-1$ and contains  the variety $V(p)$ defined by $p,$ so $Y=V(p),$ which by the Nullstellensatz means any polynomial that is zero on $V(p)$ must be in the ideal $(p).$
