hello
I've a db with some data
I want to check content, if title dosen't exist create it and if exist continue.
My db column is -->id--title--introtext--fulltext--link
anyone can help me?
check duplicate
Moderator: General Moderators
-
amargharat
- Forum Commoner
- Posts: 82
- Joined: Wed Sep 16, 2009 2:43 am
- Location: Mumbai, India
- Contact:
Re: check duplicate
If you are going to check with "title" then you should declare "title" as an unique key. so duplicate data in a "title" field will be ignored
Now, write the code to insert the data
e.g. insert into table_name(title) values('Concept')
above query insert new entry if value "Concept" not exists.
else entry will be ignored if exists.
so no need to check the condition
Now, write the code to insert the data
e.g. insert into table_name(title) values('Concept')
above query insert new entry if value "Concept" not exists.
else entry will be ignored if exists.
so no need to check the condition