试图迁移到 php pdo... 有人可以告诉我为什么这段代码不起作用吗?
$stmt = $db->prepare("SELECT SUM(aw_score) AS awscoreaw, SUM(hm_score) AS awscoreaw_def FROM nfl_new WHERE away=:away AND date<:date AND Season=:season");
$stmt->bindValue(':away', $row['away'], PDO::PARAM_STR);
$stmt->bindValue(':date', $row['date'], PDO::PARAM_STR);
$stmt->bindValue(':season', $row['Season'], PDO::PARAM_STR);
$stmt->execute();
$affected_rows = $stmt->rowCount();
echo $affected_rows.' ';
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo $rows['awscoreaw_def'].' '.$row['away'].'<br />';