I am having trouble creating mySQL query with PHP. We have one table, called data_instant, with an introduced sequence of cumulative observations called Count_Qty, and we want to extract the previous one to subtract from the new observation to calculate the increase.
$result = mysql_query("SELECT *, MAX(Record_Time) FROM data_instant WHERE Node_ID='$nodeID' AND Type='$type'; $row = mysql_fetch_array ($result);
Basically, I would expect the maximum Record_Time string to be returned, but instead it will be only the first instance received. The previous observation has the highest Record_Time (Unix installation date), so itβs not clear to me why this will not work ...
source share