I have put a unique index on my database table for steamid
. I am unsure how I can insert a record with duplicate values for this key (dropping the old record) without getting an error. Could someone edit my code to make it suitable, Thanks.
$sql = "INSERT INTO steam_data (reg_date, reg_year, steamname, steamid) VALUES ('$dateoutput', '$dateoutputyear', '$personaname', '$steamid')";
The error is :
Error: INSERT INTO steam_data (reg_date, reg_year, steamname, steamid) VALUES ('March 20, 07:09pm', '2017', 'Aweosmedude', '76561113498123831721') Duplicate entry '76561113498123831721' for key 'steamid'