duplicate record notification
Moderator: General Moderators
duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or not. How can I do this ??
- markusn00b
- Forum Contributor
- Posts: 298
- Joined: Sat Oct 20, 2007 2:16 pm
- Location: York, England
Re: duplicate record notification
Do a search on the database and compare the values.lipun4u wrote:In my database, after insertion of records, I want to know if the record inserted is duplicate or not. How can I do this ??
Code: Select all
SELECT `id` FROM `db_name`.`tbl_to_srch` WHERE `some_clmn` = '$text';
Re: duplicate record notification
It seems to me you should want to check for possible duplicate before inserting a new record. In any case, what do you mean by "duplicate"? Duplicate ID number? Duplicate Name? Completely identical record? If it's a duplicate ID number, you should be using a primary key, which will reject any attempt to insert a duplicate key.lipun4u wrote:In my database, after insertion of records, I want to know if the record inserted is duplicate or not. How can I do this ??