SyntaxFix
Write A Post
Hire A Developer
Questions
The best approach to this problem is first making the database column UNIQUE
ALTER TABLE table_name ADD UNIQUE KEY
THEN INSERT IGNORE INTO table_name ,the value won't be inserted if it results in a duplicate key/already exists in the table.
THEN INSERT IGNORE INTO table_name