From 1e59ddb4d7fd2fa99bce62d99b21c1d8c0d43f86 Mon Sep 17 00:00:00 2001 From: flykhan Date: Sat, 28 Oct 2023 15:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=88=86=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=EF=BC=88=E7=AC=AC=E4=BA=8C=E6=AC=A1=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=88=90=E5=8A=9F=EF=BC=8C=E4=BD=86=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=8B=BF=E5=88=B0=E7=9A=84=E6=80=BB=E6=95=B0=E6=8D=AE=E8=BF=98?= =?UTF-8?q?=E6=98=AF10=E6=9D=A1=EF=BC=8C=E5=BE=85=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cgi-bin/green_house_info_show.c | 4 ++-- html/green_house_info_show.html | 38 ++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/cgi-bin/green_house_info_show.c b/cgi-bin/green_house_info_show.c index 7fe0eb4..f9723f4 100644 --- a/cgi-bin/green_house_info_show.c +++ b/cgi-bin/green_house_info_show.c @@ -68,8 +68,8 @@ int main(int argc, char const *argv[]) char query_sql[128] = ""; sprintf( query_sql, - "select temperature, humidity , th_date_time from temp_hum_info;"); // 构建查询 - // "select temperature, humidity , th_date_time from temp_hum_info order by thid desc limit %d offset %d;", limit, (page - 1) * limit); // 构建查询 + // "select temperature, humidity , th_date_time from temp_hum_info;"); // 构建查询 + "select temperature, humidity , th_date_time from temp_hum_info ORDER BY thid DESC LIMIT %d OFFSET %d;", limit, (page - 1) * limit); cJSON *result_array = cJSON_CreateArray(); diff --git a/html/green_house_info_show.html b/html/green_house_info_show.html index 5e457dd..8837690 100644 --- a/html/green_house_info_show.html +++ b/html/green_house_info_show.html @@ -66,17 +66,20 @@ - +
-
--> +