0
合計合計の例とヘルプをありがとうございます。 どうやら私が見逃している何か:mysqlで合計を実行中SELECT
<?php
include 'connect.php';
$tdebit=0;
$tcredit=0;
$sql = <<<SQL
SELECT ...., ($tdebit=$tdebit+debit) AS tdebit,
($tcredit=$tcredit+credit) AS tcredit
FROM accounting
SQL;
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
$items = array();
while($row = $result->fetch_assoc()){
array_push($items, $row);
}
echo json_encode($items);
mysqli_close($con);
?>
フィールド(クレジット/デビット)と0の値は、値がゼロの場合ならば、結果は1です。 'SET'または ':='はサポートされていません。クエリは実行されません。任意の助け
おかげで、実行中の合計JPB