diff --git a/functions/functions.php b/functions/functions.php index 8523ed2..01a1dd1 100644 --- a/functions/functions.php +++ b/functions/functions.php @@ -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();