MySQL ストアド プロシージャから OUT パラメータを取得する必要があります。これを説明するものは何も見つかりません(そして私にとっては理にかなっています)。
try {
$dsn = 'mysql:dbname=db_name;host=localhost';
$dbh = new PDO($dsn, 'usr_name', 'password');
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
$stmt = $dbh->prepare("CALL db.stprNewUser(:usrEmail,:newUserOK,:stprComment)");
$stmt->bindParam(':usrEmail', $tmpEmail, PDO::PARAM_STR);
$stmt->bindParam(':newUserOK', $newUserOK, PDO::PARAM_INT,1);
$stmt->bindParam(':stprComment', $stprComment, PDO::PARAM_STR,100);
$stmt->execute();
$outputArray = $dbh->query("select @newUserOK, @stprComment")->fetch(PDO::FETCH_ASSOC);
print "procedure returned [" . $outputArray['@newUserOK'] . $outputArray['@stprComment'] . "]\n";
別の SO 項目の最後の 2 行を見つけましたが、NULL 値を返すだけです。