There are a few different options. The easiest is to make whichever field(s) can't be duplicated unique columns in the table, setting the database to reject any duplicate data. (Just make sure you have something in the PHP that will handle the INSERT "failure" gracefully. If it's a combination of fields that can't be duplicated instead of one by itself, you could also do checks against the table before inserting...do a SELECT on whatever combo you don't want duplicated, then do a row result count and make sure it's < 1.