以下のように、updateする内容を配列でもって、それをexecuteすれば、そのまま反映されます。
<?php $dsn = "mysql:dbname=stock;host=localhost"; $user = "root"; $password = ""; try { $dbh = new PDO($dsn, $user, $password); } catch (PDOException $e){ print('connection failed:'.$e->getMessage()); } $change = array(420, 21, 2929); $sql = "UPDATE stoph SET price = ?, ratio = ? WHERE code = ?"; $stmt = $dbh->prepare($sql); $stmt->execute($change); // $sql = "UPDATE stoph SET price = :price WHERE code = :code"; // $stmt->execute(array(':price'=>425, ':code'=>2929)); ?>