SQLで同じパラメータを使用しようとしていますが、最初のものしか認識していません。私のコードを見てください:
$stmt = $dbh->prepare("SELECT
(SELECT SUM(oq.value)
FROM operations_quotas AS oq
JOIN operations AS o ON oq.operation = o.id
WHERE o.user = :user AND o.type = 1 AND oq.status = 1
) AS total_incomes_open,
(SELECT SUM(oq.value)
FROM operations_quotas AS oq
JOIN operations AS o ON oq.operation = o.id
WHERE o.user = :user AND o.type = 1 AND oq.status = 2
) AS total_incomes_wroteoff");
$stmt->bindParam(":user", $this->getId());
$stmt->execute();
それは可能ですか?