我希望PHP告诉我何时记录了最高/最低温度。
这将产生最高温度OK:
remotes
以时间戳记形式存储的测量的日期和时间,标记为“ 已添加”的行。
我尝试了无数个想法,如下所示,但无济于事:
$result1 = mysqli_query($db,"SELECT MAX(Temp) AS max_temp FROM readings");
$row = mysqli_fetch_array($result1);
echo "Max temp ". $row["max_temp"]."<br>";
答案 0 :(得分:1)
您缺少存储时间戳的列名,也没有指定WHERE
子句。
$result = mysqli_query($db,"SELECT MAX(Temp) AS max_temp FROM readings WHERE Added BETWEEN '2019-11-01' and '2019-11-30'");