Add last meter consumption value.

This commit is contained in:
2024-05-04 12:04:51 +02:00
parent c8001590cf
commit 4c1171ba6c

View File

@@ -113,7 +113,7 @@ function get_year_production(mysqli $db, string $table, $date): array
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);
$data = $value_result->fetch_assoc();