I have a table in my db:
code | name | club | price | points
At the moment code is set as primary key so when I use the following script the table gets updated correctly:
$query = "INSERT INTO playerlist (code, name, club, price, points, position)
VALUES ('$listitem[0]', '$listitem[1]', '$listitem[2]', '$listitem[3]', '$listitem[4]', '$position')
ON DUPLICATE KEY UPDATE points=$listitem[4]";
mysql_query($query) or die('Error, insert query failed');
however now I am trying to add an id auto increment primary key column but the above script stops working correctly as its now referencing from id rather than code. Instead of updating a previous entry it adds another. Is there a way around this?
thanks