Let $D$ be an integral domain and $F=\mathrm{Frac}(D)$ be the field of fractions of $D$. We will look at $F$ as a set of equivalence classes from the equivalence relation $\sim$ on $D\times \left(D-\{0\}\right)$ by $(a,b)\sim(c,d)$ if and only if $ad=bc$ with the usual fraction addition and multiplication. We'll just denote $$\frac{p}{q} = \{ (a,b) \in D\times \left(D-\{0\}\right) \mid (a,b)\sim(p,q)\}=\{ (a,b) \in D\times \left(D-\{0\}\right) \mid aq=bp\}.$$
I am wondering if we have $\frac{p}{q} \in F$ under what conditions is it true that if $\frac{a}{b}=\frac{p}{q}$ then there exists some $h \in D-\{0\}$ where either $$\frac{a}{b}=\frac{hp}{hq} \text{ and $a=hp$ and $b=hq$ or } \frac{p}{q}=\frac{ha}{hb} \text{ and $p=ha$ and $q=hb$}.$$
I'd like to be able to do this to have a better idea of what the elements look like that are equal to $\frac{p}{q}$, to simplify what $\frac{p}{q}$ or $\frac{a}{b}$ looks like as a set.
Edit: Changed what I am looking for exactly I think.
In this answer, I will prove the following result, where we allow ourselves to work in only noetherian rings when necessary:
Let's start with a lemma. It is a restatement of this property in terms of ideals.
The total order on the principal ideals is a strong property, we will call the property $T$ to save typing. For instance,
And moreover,
Consider the case $D$ is a noetherian integral domain with $T$. Then $D$ is a principal ideal domain, and thus it is a unique factorization domain. The only irreducible element of $D$, however, is the generator $m$ of the maximal ideal; this is because, in principal ideal domains, irreducible elements generate maximal ideals. Thus, if $a\in D$, then $a$ is a unit multiple of a power of $m$. This completes the proof of the theorem.