I am trying to select and sum subtotal from the cart table, but we are unable to sum
<?php
// This will get all related products
mysqli_select_db($conn, $dbname);
$query_gettotal = "SELECT subtotal FROM cart WHERE scode ='$gu'";
$gettotal = $conn->query($query_gettotal);
$row_gettotal = mysqli_fetch_assoc($gettotal);
do{
$a = array($row_gettotal['subtotal']);
foreach ($a as $value) {
//print $value;
//print_r($a);
//getting value 190047509503800
// how to add 1900 4750 950 3800
}
} while ($row_gettotal = mysqli_fetch_assoc($gettotal));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…