php - Duplicate Data for Primary Key -
I have a table that saves an id for the user that ID's data is found with LDAP for the first time when user logs In this, he records his identity in the table. But the users who consider me on this already have data on the database. I got the error 'duplicate entry' jodida for 'primary'. Field Since this data is the primary key but I need to go around it. $ check = "Choose from utilities * where id = '$ samaccountname [0]'"; $ H = mysql_query ($ check); If (! $ H) {dead (mysql_error ()); } $ Data = mysql_fetch_array ($ h); If ($ data [0]> 1) {header ('location: pprincipal.php'); } And {$ query = mysql_query ("Use utility (id) values ('$ samaccountname [0]');"); If (! $ Query) {dead (mysql_error ()); }} I do not want to duplicate data, I just want to know whether the data has been entered or not, and if so, then go ahead, if it is not, then data Enter / P> Note: $ samaccountname is a variable that contain...