Let q>3 denote an odd prime and d a positive integer without any prime factor p≡1(mod3). In this paper, we have proved that if (x,q)=1, then x3=dy2±q6 has exactly two solutions provided q≢±1(mod24).