You more than likely have a Primary or a Unique Index on the field you need to make sure you do not get duplicate results. If its a primary field use auto_increment, if its unique you will need to check if the value already exists before entering that data into the database.