0
good afternoon!
I’m a beginner in php and I’m trying to build a table that tells the date and the sum of sales made, however, I can only present the sum of the values but I can not present the date mentioned... follow Cód.
$mysqli = new MySQLi( 'localhost', 'login', 'senha', 'db' );
$q_soma= ('SELECT SUM(valor) AS resultado FROM vendas GROUP BY data');
if ($result = $mysqli->query($q_soma)) {
while ($row = $result->fetch_assoc()) {
printf ("%s <br />", $row["resultado"]);
}
$result->close();
};
You need to put the date field in the field list and then print as you did with
resultado
– rray