Good afternoon!
I'm a beginner in php and I'm trying to build a table that tells you the date and sum of sales, but I can only display the sum of the values but I can not present the date ... p>
$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();
};