I'm working with morris chart but do not know how to print two types oh Results with PHP and MySQL
I have this code that seems to work well showing the number of visits in graph but wanted to include the number of different users accessing in a day but do not know how to do.
$query = "
SELECT DATE(date) AS dt, COUNT(*) AS cnt FROM `acessos` GROUP BY DATE(date)
";
$result = mysql_query($query, $fb) or die(mysql_error());
$num_rows = mysql_num_rows($result);
$(function() {
Morris.Area({
element: 'morris-area-chart',
data: [
<?php while($row = mysql_fetch_array($result)){ ?>
{
period: '<?php echo $row['dt']; ?>',
acessos: '<?php echo $row['cnt']; ?>',
user: '<?php echo $row['user']; ?>',
},
<?php } ?>],
xkey: 'period',
ykeys: ['acessos','user'],
labels: ['acessos','user'],
xLabels:['day'],
pointSize: 2,
hideHover: 'auto',
resize: true
});
});
Anyone have an idea? appreciate the help