// query para sa year of enrollment
$res = $conn->query(“SELECT *, SUM(visitor_price) FROM visitors
GROUP BY year”) or die(mysqli_error());
$data_points = array();
while($result = $res->fetch_array()){
$R = $result[‘year’];
$q1 = $conn->query(“SELECT *, SUM(visitor_price) as total FROM visitors
WHERE year
= ‘$R’ group by year”) or die(mysqli_error());
$f1 = $q1->fetch_array();
$FR = intval($f1[‘total’]);$R = $result[‘year’];
$point = array(‘label’ => $R, ‘y’ => $FR);
array_push($data_points, $point);
}
json_encode($data_points);
this is my query by year and I would like to know by Weeks