Add last meter consumption value.
This commit is contained in:
@@ -113,7 +113,7 @@ function get_year_production(mysqli $db, string $table, $date): array
|
|||||||
|
|
||||||
function get_last_value(mysqli $db, string $table, $date): float
|
function get_last_value(mysqli $db, string $table, $date): float
|
||||||
{
|
{
|
||||||
$value_query = 'SELECT last_value FROM ' . $table . ' WHERE date LIKE "' . $date . '%" ORDER BY date DESC LIMIT 1;';
|
$value_query = 'SELECT `last_value` FROM ' . $table . ' WHERE date LIKE "' . $date . '%" ORDER BY date DESC LIMIT 1;';
|
||||||
$value_result = $db->query($value_query);
|
$value_result = $db->query($value_query);
|
||||||
$data = $value_result->fetch_assoc();
|
$data = $value_result->fetch_assoc();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user