php mysql pdo SELECT SUM
$sql = $pdo->prepare("SELECT SUM(quantity) FROM card WHERE phone='$phone'");
$sql->execute();
$row = $sql->fetchColumn(0);
php mysql pdo SELECT SUM
$sql = $pdo->prepare("SELECT SUM(quantity) FROM card WHERE phone='$phone'");
$sql->execute();
$row = $sql->fetchColumn(0);