diff --git a/api/blueweather.php b/api/blueweather.php index b7623e8..86b64ca 100644 --- a/api/blueweather.php +++ b/api/blueweather.php @@ -146,8 +146,8 @@ class BlueWeather JOIN sensors S ON M.sensorid = S.id JOIN locations L ON S.locationid=L.id WHERE L.id=$locId AND M.timestamp > " . $range['from'] . - "AND M.timestamp < " . $range['to'] . " - ORDER BY timestamp ASC"; + " AND M.timestamp < " . $range['to'] . + " ORDER BY timestamp ASC"; $result = $this->_con->query($sql); diff --git a/api/json.php b/api/json.php index f58c536..da76b21 100644 --- a/api/json.php +++ b/api/json.php @@ -26,7 +26,7 @@ $blueweather = new BlueWeather($config); if (isset($_GET['locId'])) { // get data of given location - $data = getLocationData($_GET['locId'], $_GET['range'], $_GET['maxVals']); + $data = $blueweather->getLocationData($_GET['locId'], $_GET['range'], $_GET['maxVals']); } else { $data = $blueweather->getAllLocations(); }