I import outlook contacts file into my database and then display it into html table. The table is created and everything is ok, but when I try to upload it a second time, all names and information is doubled. So what I want to do is if the first name and the last name already exists just to update the row and all cells in that row and not insert that row over and over again.
"CREATE TABLE contacts(PID INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(PID),first_name CHAR(80),middle_name CHAR(80),last_name CHAR(80)"
I tried with on duplicate key update/replace but it didnt work.
"INSERT INTO contacts (first_name,middle_name,last_name)
VALUES ('$first_name','$middle_name','$last_name')"
I guess my problem is in the auto_increment and primary key but I don't really understand how they work and how to do that.