Let a, b, c be integers. We provide a necessary condition for the function |ax 2 + bx + c| to generate only primes for consecutive integers. We then apply this criterion to give sufficient conditions for the real quadratic fieldto have class number one, in terms of prime-producing quadratic polynomials.