in reply to MySQL syntax error for ON DUPLICATE KEY UPDATE
It seems that your SQL statement is failing because the placeholders in your "ON DUPLICATE KEY..." clause lack bind values when you invoke your SQL with "execute".
I suspect you are passing only five values when you "execute". Your statement requires ten values, i.e. TWO copies of your variable set -- one after the other.
HTH
In Section
Seekers of Perl Wisdom