It turns out the converse is also true.
If a given ring has the property that if ab = 0 then either a=0 or b=0, then there is a unique field that embeds it and is generated by it. We can define this field as equivalence classes of pairs (n, d), where d is not 0, and the equivalence relation is (n,d) is equivalent to (m,b) iff nb=md (diagonal multiplication). The embedding is given by n |-> (n,1). The field is called the ring's quotient field. Note that applying this procedure to the ring of integers gives the field of rationals.