I'm about to build a jquery chart that involves median order income number of customer etc for each day.
At this moment if I try my chart I get like 500 customers from the year 2012-2017 which is the total and not moving linearly to what I would like to.
What I want to make is that I get 0 - > 500 customers.
Could I loop these query or something to get data from all span and pull the number of customers so my data table shows, the neat line in the Jquery data-table?
Any pointers would be appreciated. I'm rather a novice on this kind of "advanced" MySQL queries
$from_date = strtotime($fDay.date('F',mktime(0,0,0,$fMonth,15,2006)).$fYear);
$to_date = strtotime($tDay.date('F',mktime(0,0,0,$tMonth,15,2006)).$tYear);
$from_datetime = date_create(date("Y-m-d", $from_date));
$to_datetime = date_create(date("Y-m-d", $to_date));
//Statistikvariabler
$all_orders = $DBcon->query("SELECT * FROM `order_structure` WHERE `date`>={$from_date} && `date`<={$to_date}");
//Räkna ut totalsumma från och med nyår
$all_orders_sum = $DBcon->query("SELECT * FROM `order_structure` WHERE `date`>={$from_date} && `date`<={$to_date}");
$all_sum = 0;
//Använd ovanstående för att räkna ut snittorder
while($sum = $all_orders->fetch_assoc() ){
$all_sum += $sum['sum'];
}
//Räkna ut debiterade timmar
$all_orders_debs = $DBcon->query("SELECT * FROM `order_data` WHERE (`status`=3 || `status`=4) && `date`>={$from_date} && `date`<={$to_date}");
$all_time = 0;
$all_prods = 0;
while( $debs = $all_orders_debs->fetch_assoc() ){
$all_time += $debs['minutes'];
$all_prods += $debs['sek'];
}