I have formed a MySQL query that works ok from phpmyadmin SQl query
I have written some php to perform the same query.
The query works but I cannot extract and manipulate the result.
$query = “SELECT MAX(speed) FROM positions where DATE(devicetime) = CURDATE()”;
I get back an array of length 1. I cannot get the value from it at all.
The “print_r” shows the following:
(
[MAX(speed)] => 32
)
I want to get the value 32.
An extract of the code is below.
$query = “SELECT MAX(speed) FROM positions where DATE(devicetime) = CURDATE()”;
$result= mysqli_query($opendb,$query) or die("Query failed " ) ;
$row = mysqli_fetch_assoc($result);
print_r($row);