Let $D$ be a positive integer, and let $p$ be an odd prime with $p\nmid D$. In this paper we use a result on the rational approximation of quadratic irrationals due to M. Bauer, M. A. Bennett: Applications of the hypergeometric method to the generalized Ramanujan-Nagell equation. Ramanujan J. 6 (2002), 209–270, give a better upper bound for $N(D, p)$, and also prove that if the equation $U^2-DV^2=-1$ has integer solutions $(U, V)$, the least solution $(u_1, v_1)$ of the equation $u^2-pv^2=1$ satisfies $p\nmid v_1$, and $D>C(p)$, where $C(p)$ is an effectively computable constant only depending on $p$, then the equation $x^2-D=p^n$ has at most two positive integer solutions $(x, n)$. In particular, we have $C(3)=10^7$.