/** * Delete old registry entries * * @param $glpi_computers_id integer : glpi computer id. * * @return nothing. **/ static function resetRegistry($glpi_computers_id) { global $DB; $query = "SELECT *\n FROM `glpi_registrykeys`\n WHERE `computers_id` = '{$glpi_computers_id}'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query2 = "SELECT COUNT(*)\n FROM `glpi_registrykeys`\n WHERE `computers_id` = '" . $data['computers_id'] . "'"; $result2 = $DB->query($query2); $registry = new RegistryKey(); if ($DB->result($result2, 0, 0) == 1) { $registry->delete(array('id' => $data['computers_id']), 1); } } } }