I have a php code below that sum up the column going through multiple tables and return 3 separate total amounts after the query is done since I have 3 tables. If I want to sum up those 3 total amounts into one, in what ways do I need to change the code to accomplish that?
foreach($result as $row) {
$stmt1 = $DB_CON_C->prepare("SELECT SUM(total_fee) AS total_amount FROM `".$row['files']."`");
$stmt1->execute();
$sum1 = $stmt1->fetch(PDO::FETCH_ASSOC);
echo $sum1['total_amount'];
}
$sum1in PHP.