Hai all, my head spinning away with this duplicate data, it is not because of the database, but i think because of my codes, i say that because i try enter data manually using phpmyadmin, single data will be inserted, but when i running through my application, there will be double data inserted which is the first data is the correct data while the second one contain no value but have the primary key only because i set the AUTO_INCREMENT, i already check maybe there will be a double command to execute the insert statement, but cannot find one. here i post my insert statement:
Code: Select all
$query = "insert into personal(program, nama, jantina, ic_lama, ic_baru, warganegara, keturunan, tarikh_lahir, negeri_kelahiran, alamat_tetap, alamat_pejabat, no_tel_rumah, no_tel_pejabat, no_tel_bimbit, no_faks_rumah, no_faks_pejabat, alamat_surat, approve) values ('$program','$nama','$jantina','$ic','$ic2','$warganegara','$keturunan','$hari $bulan $tahun','$select_negeri','$alamat_tetap','$alamat_pejabat','$no_rumah','$no_pejabat','$no_tel_bimbit','$no_fak_rumah','$no_fak_pejabat','$alamat_surat','$terms')";
mysql_query($query) or die('Error, insert query failed');
$query = "FLUSH PRIVILEGES";
And Here, the data in the phpmyadmin with the null value:
Thanks a bunch