MNCW2
asked on
check duplicate before insert
given table
table Directory
-------------------------
Id auto increment
Name varchar(10)
Hp varchar(12)
I need to insert around few hundreds of records in this table. But I had to make sure
'Hp' which doesn't duplicate. It means I need to check if the record exist in table which same with the record
that I want to insert. Any suggestion? Create indexes would slow insertion query. I am code in php,please help.
table Directory
-------------------------
Id auto increment
Name varchar(10)
Hp varchar(12)
I need to insert around few hundreds of records in this table. But I had to make sure
'Hp' which doesn't duplicate. It means I need to check if the record exist in table which same with the record
that I want to insert. Any suggestion? Create indexes would slow insertion query. I am code in php,please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OR
Use REPLACE instead of INSERT, assuming 'name' will be the same for any matching HP value