0
I need to get the date and put it on a chart of Google Chart
, for example:
Sales today, this week, this month.
$sql = "SELECT dataCaptura FROM produtos";
//Trazendo resultados da tabela
$result = mysqli_query($conexao, $sql);
//Condição para formar gráfico
$cont_hoje = date('d');
$cont_semana =date('w');
$cont_mes =date('m')
while($linha = mysqli_fetch_assoc($result)){
if($linha['dataCaptura'] == date('d')){
$cont_hoje++;
}
else if ($linha['dataCaptura'] =='date('w')){
$cont_semana++;
}
else if ($linha['dataCaptura'] =='date('m')){
$cont_mes++;
}
}
?>
but I can’t do show the amount of sales made today.
has extra quotes in both elses.. that might be the problem??
=='date(...)
– rLinhares
Corrected, but unsuccessfully, I want to get the amount that was sold today through the date, but the only value it gives me is the date number of today and not the amount of items that were sold today.
– Diego Fernando