//echo "<br />80: " . $update; $upd = $db_CS->query($update); if ($db_CS->affected_rows > 0) { $update = "update TagList set tagCount = tagCount + 1 where id = '" . $row2->id . "'"; $db_CS->query($update); $updated++; } //echo $update."<br />"; } } } } } } echo "updated {$updated} devices for tag {$tag}"; } function checkModify($db_CS, $tag) { } //$tag = "tDeviceFirmware"; flushDeviceTags($db_CS); updateDeviceTags($db_CS, "tRegionName"); updateDeviceTags($db_CS, "tDeviceVPNName"); updateDeviceTags($db_CS, "tDeviceFirmware"); updateDeviceTags($db_CS, "tLastAliveIP"); $devicePrefixes = array("EW", "EH", "SK", "KS", "FK", "KB", "AR", "FP"); createDeviceTags($db_CS, $devicePrefixes); updateDeviceTags($db_CS, "tLastAliveIP"); updateDeviceTags($db_CS, "tDeviceFirmware"); checkModify($db_CS, "tRegionName");
<?php ini_set("display_errors", 1); include "db_connect.php"; global $db_CS; $db = $db_CS; function checkModify() { global $db; $modifiedSQL = "SELECT * FROM DeviceListHistory WHERE paramName != 'bAlive' AND eventTime > " . (time() - 30) . " ORDER BY eventTime DESC"; if ($modifiedSQL = $db->query($modifiedSQL)) { while ($modifiedEntry = $modifiedSQL->fetch_object()) { echo $modifiedEntry->tDeviceVPNName . " " . $modifiedEntry->paramName . " " . $modifiedEntry->oldValue . " -> " . $modifiedEntry->newValue . " @ " . $modifiedEntry->eventTime . "<br />\n"; } } } checkModify();