Problem in unique columns

HI,I have a table with 5 columns

example:

id = primary key auto_increment
userid =varchar(5)
lat = float (10,6)
lng =float (10,6)
date = dateTime

Is it possible to insert a record that will not have duplicate to other rows ?,I tried to put unique index but it’s not working.


inserting firstrecord - > 1 , 00002 , 57.7753624 , -101.6773852 , 2014-07-08 23:07:34
inserting secondrecord- > 1 , 00002 , 57.7753624 , -101.6773852 , 2014-07-08 23:07:35//this will insert because "date" is different to to other rows
inserting thirdrecord - > 1 , 00002 , 57.7753624 , -101.6773857 , 2014-07-08 23:07:34//this will insert because "lng" is different to to other rows
inserting fourthrecord - > 1 , 00002 , 57.7753624 , -101.6773852 , 2014-07-08 23:07:34//This will not be inserted having duplicate to other rows

Thank you in advance.

If you put a unique constraint for lat and lng, then any particular combination cannot be entered a second time.

what about a geocaching app? wouldn’t be any good if it only records the first person to find it