Der manglede en parentes. Du kan også bruge VALUES(column)
i ON DUPLICATE KEY UPDATE
afsnit i erklæringen:
cursor = database.cursor()
cursor.execute("""
INSERT INTO userfan
(user_id, number, round)
VALUES
(%s, %s, %s)
ON DUPLICATE KEY UPDATE
-- no need to update the PK
number = VALUES(number),
round = VALUES(round) ;
""", (user_id, number, round) # python variables
)
database.commit()