try using a select function before you insert, looking for fields which already have the same values... i.e.
if you want to enter a person's details, name, age, sex, location... before you insert into the database, try:
select * from PersonTb where name='".$name."' AND age='".$age."' AND sex='".$sex."' AND location='".$location."'
and if it does already exist, dont enter the new record.
hope thats what you were looking for