Let $D$ be an integral domain (zero ideal is prime). Then for every nonzero element $a,b \in D$, we have $\langle a\rangle\cap \langle b\rangle\neq 0$.
Now in a general case, let $R$ be a commutative ring with 1, such that $R$ has no nontrivial idempotent. I am looking for a general condition (other that $0$ is an irreducible ideal) for $0$ (the zero ideal) under which $\langle a\rangle\cap \langle b\rangle\neq 0$ for all nonzero element $a,b \in R$.