php - How to check if a value already exists to avoid duplicates? -
i've got table of urls , don't want duplicate urls. how check see if given url in table using php/mysql?
if don't want have duplicates can following:
- add uniqueness constraint
- use "replace" or "insert ... on duplicate key update" syntax
if multiple users can insert data db, method suggested @jeremy ruten, can lead error: after performed check can insert similar data table.
Comments
Post a Comment