function updateOnly($db_CS) { $devicePrefixes = array("EW", "EH", "SK", "KS", "FK", "KB", "AR", "FP", "MB", "MD", "MK"); updateDeviceTags($db_CS, "tDeviceVPNName"); createDeviceTags($db_CS, $devicePrefixes); updateDeviceTags($db_CS, "tRegionName"); updateDeviceTags($db_CS, "tDeviceFirmware"); updateDeviceTags($db_CS, "tLastAliveIP"); }
$update = "UPDATE DeviceTags SET tTagIds = concat(tTagIds,','," . $row2->id . ") WHERE tDeviceVPNName = '{$tDeviceVPNName}' AND FIND_IN_SET('" . $row2->id . "', tTagIds) = 0"; //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");