I am using the following code to insert records into a temporary table then to check for duplicate records in my temporary table and then inserting into my duplicate table.
$sql1="INSERT INTO users_working (`fName`, `lName`,`validation`,`datestamp`,`status`) VALUES ('$first','$last','$valid','$datestamp','$status')";
$c1 = mysql_affected_rows();
$r1 = mysql_query($sql, $importer) or die("<br>Error: ".mysql_error());
$sql2="SELECT * FROM users_working INNER JOIN users ON users_working.validation=users.validation";
$r2=mysql_q2uery($sql2,$importer)or die("Error: ".mysql_error());
$c2-mysql_num_rows($r2);
This code is working fine. My problem is that if the file I am importing has a duplicate record then it throws this error....
Error: Duplicate error key "3322344"
Is there any way to deal with this problem as it is being inserted into the database? Right now I have to open the imported file and delete the duplicate record manually... I need a way to deal with it from the code so the users dont need to call me.
Thanks...