3
I fed this graph
But I have a problem with his selection
<?php
$sql_2_vis = mysqli_query($config, "SELECT data, uniques, pageviews FROM tb_visitas ORDER BY id DESC LIMIT 7") or die(mysqli_error($config));
if(@mysqli_num_rows($sql_2_vis) <= '0'){
echo "
<div class=\"col-lg-6\">
<div class=\"alert alert-danger\">
<strong>Erro!</strong> $erro
</div>
</div>
";
}else{
$count_vis = 0;
while($r_sql_2_vis = mysqli_fetch_array($sql_2_vis)){
$data_sel = $r_sql_2_vis[0];
$uniques_sel = $r_sql_2_vis[1];
$pageviews_sel = $r_sql_2_vis[2];
if($count_vis++) echo ', ';
echo '["' . date("d/m", strtotime($data_sel)) . '",' . $uniques_sel . ']';
}
}
?>
It would be necessary to display, in this case, 05/05, 06/05, 07/05... And it’s the other way around.
If I give a ORDER BY id ASC
, He’ll get the first records.
I saw in some places that it is possible to make a select within the select, but it did not work either.
check on the chart that should have option to invert the display
– Rovann Linhalis
If your question has been answered, please choose the answer to finalize the question.
– Leticia Rosa