mi viene il dubbio sul campo :terminale messo due volte nella query ed uno solo nei bindParam.

giusto per fare una prova se puoi:
Codice PHP:
  $pdo = new PDO("mysql:host=$host;dbname=$db_name"$username$password); 
    
$query $pdo->prepare(
    INSERT INTO tabella  
    (prodotto, quantita, terminale)  
    VALUES  
    (:prodotto, :quantita, :terminale) 
    ON DUPLICATE KEY UPDATE  
    quantita= :quantita2, terminale= :terminale2'
); 
 
 
    
$query->bindParam(':prodotto'$prodotto);   
    
$query->bindParam(':quantita'$quantitaPDO::PARAM_STR); 
    
$query->bindParam(':terminale'$terminalePDO::PARAM_STR); 
    
$query->bindParam(':quantita2'$quantitaPDO::PARAM_STR); 
    
$query->bindParam(':terminale2'$terminalePDO::PARAM_STR); 
cmq, a prescindere, che errori hai??