dreamwest Posted August 26, 2009 Share Posted August 26, 2009 Im trying to create a unique field, but when i test it and try to insert a duplicate row i get a error error: Duplicate entry 'test' for key 2 Is there a way i can test the string "test" to see if its unique before inserting it?? Quote Link to comment https://forums.phpfreaks.com/topic/171882-create-uniuqe-field/ Share on other sites More sharing options...
asmith Posted August 26, 2009 Share Posted August 26, 2009 you can use INSERT IGNORE INSERT IGNORE INTO TABLE ... rest of your query for more info check this out: http://dev.mysql.com/doc/refman/5.1/en/insert.html Quote Link to comment https://forums.phpfreaks.com/topic/171882-create-uniuqe-field/#findComment-906621 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.