modified: server.js

This commit is contained in:
IrisVega 2024-07-20 17:12:35 +08:00
parent d27b061fe4
commit 0416545e38

View File

@ -53,7 +53,7 @@ function getSensorData(callback) {
// 获取数据库中最新的数据
function getLatestSensorData(callback) {
const sql = 'SELECT temperature, humidity, co2, pressure timestamp FROM sensor_data ORDER BY id DESC LIMIT 1';
const sql = 'SELECT temperature, humidity, co2, pressure,timestamp FROM sensor_data ORDER BY id DESC LIMIT 1';
db.query(sql, (err, results) => {
if (err) {
console.error('Error fetching latest sensor data: ', err);