In the presence of a nonlinear effect called four-wave mixing (FWM), two prime codes named modified quadratic congruence code (MQCC) and modified prime code (MPC) are compared to investigate their effectiveness in incoherent spectral amplitude coding optical code division multiple access (SA OCDMA) system with multiple wavelengths. For the purpose of analyzing the ber error rate of the proposed system, a number of noises are taken into account, including FWM-induced noise, receiver noise, phase-induced intensity noise (PIIN), and multiple user interferences (MUI). The code with the optimum code weight and length and fixed inphase cross-correlation value displays better results owing to improved SNR and reduced MAI.