I try to show a curve with energy produced for a day. So the curve must always be growing.
I try to increment the variable "energie_journ" my mysql database with all previous.
Exemple:
Mysql:
ID energie_journ
1 5
2 5
3 10
4 6
Desired result:
First energie_journ = 1, the second = 10 (5 +5), third = 20 (5 +5 +10), fourth = 26 (5 +5 +10 +6).
Bit php:
while ($row2 = mysql_fetch_array($result2)) {
extract($row2);
$datetime *= 1000;
$encode_energie_journ[] = array((float)$datetime, (float)$energie_journ == null ? null : (float)$energie_journ);
}
Thanks.