1
0

Debug serveur stats\nDebug

This commit is contained in:
2022-05-05 21:28:26 +02:00
parent d1f1065e44
commit 68fb0579ce
11 changed files with 159 additions and 124 deletions

View File

@ -27,7 +27,7 @@ class db extends mysqli
{
logger(ERROR, _("Connection to sql server ready"), __FILE__ . ":" . __LINE__);
}
$result = new mysqli_result($this);
$this->result = new mysqli_result($this);
}
function protect($string)
@ -47,7 +47,7 @@ class db extends mysqli
$ieeeAddress = $device->ieeeAddress;
//print_r($ieeeAddress);
$query = "INSERT INTO logs (device, property, value) VALUES('" . $this->protect($ieeeAddress) . "', '" . $this->protect($property) . "', '" . $this->protect(bool2string($value)) . "')";
echo $query . EOL;
//echo $query . EOL;
if (is_numeric($value) and !empty($properties2log[$property]))
{
// calculate a min/max value for storing data
@ -66,7 +66,7 @@ class db extends mysqli
if ($value >= $oldValue - $minMax and $value <= $oldValue + $minMax)
{
//echo "========>>>>>>>>>not changed" . EOL;
return 0;
return true;
}
}
if ($testMode)